Skip to content

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

  1. Open an issue or MR with Network Dev tools open
  2. Start typing @ in the comment box
  3. Ensure that the response wasn't served from cache
  4. Open a new page with the same URL
  5. Start typing @ in the comment box
  6. Ensure that the response wasn't served from cache
  7. Execute `Feature.enable(:cache_autocomplete_sources)
  8. 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.

Related to #427436 (closed)

Edited by Dmitry Gruzd

Merge request reports

Loading