Cache Query parameter in AWS Cloudfront — Part 1

  • None(Improve caching)
  • Forward All, Cache based on all
  • Forward All, Cache based on whitelist
  • The first option: None (Improve caching) should not be used because we have many request parameter which needs to be sent to AEM
  • We have to allow ignoreUrl parameter in the dispatcher otherwise Cache-Control header cannot be set by Apache. One possibility is that we can set Cache-Control via AEM Sling filter and the dispatcher will create a header file (en.html.h) and add Cache-Control info inside of it but in this case, we have to maintain a separate list of allowed parameters which is not very good in terms of maintainability.
  • The query parameter value should be always in lowercase because for example a parameter ?color=Red and ?color=red will cause Cloud-Front to cache two different objects. Our code should always support lower-case and to make sure values entered by the end-users are always in lowercase, we need to write Lambda@Edge to pass lowercase always to the origin server.
  • My suggestion will be to use “Forward all, cache based on all” because we do not have to maintain a separate list of allowed query parameters, and also most importantly if we do not know the query parameters and have 301 redirects then we will get an infinite loop, more details here:

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Dell Inspiron 5370 — Developer Review (After 6 months of Usage)

The path to education through code

Cloud GeoServer in 20 minutes

How to reconnect/return to your windows server instance EC2 AWS

Lighting in Maya by using “Python”

How To Process A 1 TB DataFrame In 30 Seconds With A 3 TB Dask Cluster

What’s the difference between Dynamic libraries and Static libraries!

Poly Network AMA Events with RioDefi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sumanta pakira

Sumanta pakira

More from Medium

How to Create a NoSQL Table using Amazon DynamoDB

Amazon API Gateway : Enabling CORS support in mock API response

Security by design for cloud secrets

How to Build a Serverless Application Using AWS SAM with API Gateway and Lambda