How can I use CloudFront-Viewer-Country to set up country-based caching?

0
13
Asked By TechGuru42 On

I'm trying to figure out how to leverage the CloudFront-Viewer-Country header to customize responses for specific countries. I'm feeling stuck because the documentation isn't very clear. Here's my situation:
- I can't see the header during the viewer request despite making adjustments to my cache and origin policies.
- I can see it on the origin request, but at that point, it's too late to change the cache key.

My goal is to set up just two caches: one for country A and another for the rest of the world. I don't want to end up creating separate caches for each country. Can anyone tell me what I'm missing or the best approach to achieve this?

1 Answer

Answered By DevNinja99 On

Setting up your caches this way might be a bit tricky with CloudFront since there isn’t really a separate cache for users by country. Can you clarify what you want to achieve?

TechGuru42 -

I meant that I want to only differentiate between country A and the rest of the world, so I don't want a cache for every individual country. Adding CloudFront-Viewer-Country to the cache key feels like it would just over-complicate things.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.