Skip to content

Cache search#autocomplete on the frontend

Dmitry Gruzd requested to merge cache-search-autocomplete into master

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

SCR-20230217-jcb

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Open the Network tab in the developer tools of your browser
  2. Ensure that you don't have Disable cache checked.
  3. Type something in the search field
  4. 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)
  5. Enable caching in your GDK touch tmp/caching-dev.txt
  6. Restart rails-web
  7. Type something unique in the search field
  8. 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.

#392018 (closed)

Edited by Changzheng Liu

Merge request reports

Loading