1

We use CloudFront for caching user requests on CDN level.

The problem is that we want to pass User-Agent header to origin to be able to track it but we do not want to use it as caching key(there are just too many User agents and value of caching will be zero).

When using Whitelist strategy for headers AWS Cloudfront cuts all headers which are not whitelisted and are not default and doesn't send them to origin.

As we use Whitelist Forward strategy now, one of the solutions will be to switch to All strategy but we do like other headers that we are using as cache keys.

Any ideas?

I checked similar questions, but found no answer to this question by far:

Dmytriy Voloshyn
  • 1,032
  • 12
  • 27
  • 2
    Your reasoning seems circular. If it were possible to pass `User-Agent` to the origin without using it as part of the cache key, the `User-Agent` values you'd see at the origin would only be an occasional, non-meaningful, non-representative sample value, because most requests would be served from the cache, not the origin... so the origin could not meaningfully "track" it, and your purposes are not accomplished. Please explain how this would be of value. – Michael - sqlbot Apr 10 '18 at 16:40
  • You are completely right. I read your comment and it seems you answered my question and corrected my reasoning. Thanks. Restated problem would be how can I preprocess `User-Agent` to pass to origin only a part of that header(eg. I want to understand if browser supports ES6 features) - and it looks like I need to user AWS Lambda Edge for that. – Dmytriy Voloshyn Apr 11 '18 at 09:00

0 Answers0