3
votes

I've created a Cloudfront distribution to deliver a couple of pages that may change according to the user language. Both pages are being served from an EC2 instance with an ELB in front of them.

My Cloudfront origin is the ELB and it works as expected regarding its cache default behavior. Although, I need to cache pages according to the user's Accept-Language header. For that, I created a custom header whitelist, where I included the Accept-Language header...but it does not work at all.

I've tried multiple configurations with no success. If I request the page directly through the ELB address it works as expected, but every time I use the CDN address the Accept-Language header gets removed in between. Any idea of what is going on here?

2

2 Answers

0
votes

It was just a typo...I've created a behavior for /webviews when in fact it should be /webview. I didn't get this sooner because I was always getting correct cached responses from Cloudfront but it was because that route was falling under the default behavior conditions.😅