Allow finders to be cached for 5 minutes #722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Calling
expires_in
sets aCache-Control
header for a page. This commit allows finder pages to be cached. This affects proper finders like https://www.gov.uk/aaib-reports and advanced search like https://www.gov.uk/search/advanced?group=services&topic=%2Feducation. This will cause the pages to be cached by both Fastly (our CDN) and our Varnish caching layer.We're keeping the cache TTL low because we think there's a need to see new documents quite quickly. Nevertheless, this should increase the number of cache hits, which speeds up response times and scalability by alleviating load on our origin servers.
Testing
To test this, we've set up a Gatling test (courtesy of @barrucadu) where we hit 10 different AAIB Reports URLs using 100 workers.
Before this change:
After this change:
https://trello.com/c/TiXjc60U