Our pricing page renders per request, because it reads the country header to price in the visitor's own currency. I have written about that resolution before. What I had never checked is how many distinct documents that URL can produce, so I fetched it as 20 different clients and diffed the results.
The answer is four, and the reason is that two separate regular expressions are looking at the same User-Agent string for two unrelated purposes.
Regex one: ours, 12 terms, picks the currency
It lives in lib/http/bots.ts and it is the whole of our bot detection:
export const BOT_PATTERN = / vercel | bot | crawler | spider | googlebot | bingbot | slackbot | twitterbot | facebookexternalhit | linkedinbot | whatsapp | headless / i
Enter fullscreen mode
Exit fullscreen mode
A match means the request is quoted the base currency, GBP, rather than the currency of whatever datacentre the request came from.…