Closed gigamorph closed 2 weeks ago
Created a copy of the LUX environment for testing with mock responses and configuration.
Frontend URL: https://lux-front-exp.collections.yale.edu
Restarting the web cache often fixes the problem. While strange, it may be a clue.
The custom code I wrote for Varnish had a bug that caused all the error responses to be cached. My initial assertion that web cache wasn't caching those was wrong, because I was using a different URL (i.e. the AWS given URL of the web cache) to verify my claim, which, at the time I ran it, returned 200 reflecting the fixed backend, while the frontend URL (e.g. lux.collections.yale.edu/blah) was still returning the cached 500. I was practically ignoring the fact that there were different cache values for different keys.
The code is now fixed and deployed to all envs except GREEN (the current PRD).
It's been a while and we haven't seen any report of the same problem. I propose closing this issue.
Approved by UAT to close
Problem Description: From time to time, an error response (e.g., with the HTTP status code 500) is cached with CloudFront, when it shouldn't. Web cache (Varnish) doesn't cache those (verified each time the problem occurred), so there must be a problem either in the CloudFront configuration or interaction between CloudFront and the web cache.
Expected Behavior/Solution: CloudFront shouldn't cache anything (normal or error responses). Although we may decide to cache some, such as 408, that caching should happen with the Varnish web cache, not CloudFront.