Set Cache-Control for autocomplete_sources/members
What does this MR do and why?
This is an initial iteration to improve caching for the autocomplete_sources
endpoint. It sets expires_in
to 3 minutes if cache_autocomplete_sources
is enabled.
As a second iteration after this is completed we can work on implementing ETags to allow longer cache expiry.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Open an issue or MR with Network Dev tools open
- Start typing
@
in the comment box - Ensure that the response wasn't served from cache
- Open a new page with the same URL
- Start typing
@
in the comment box - Ensure that the response wasn't served from cache
- Execute `Feature.enable(:cache_autocomplete_sources)
- Repeat the steps above, but this time the second time you should see a cached response
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #427436 (closed)
Edited by Dmitry Gruzd