Cache search#autocomplete on the frontend
What does this MR do and why?
This MR enables frontend-level caching for the search#autocomplete endpoint similar to search#count.
Screenshots or screen recordings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Open the Network tab in the developer tools of your browser
- Ensure that you don't have
Disable cachechecked. - Type something in the search field
- Type the same query and check that the response is not cached (you might see
304 Not Modified, but it is Etag caching. ES is still being hit) - Enable caching in your GDK
touch tmp/caching-dev.txt - Restart
rails-web - Type something unique in the search field
- Type the same query and check that the response is now cached (
200 OK (Disk cache))
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.
Edited by Changzheng Liu
