Automattic / Automattic/jetpack
Search Enhancement: remove or improve search result caching
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Jetpack, Search
### What
Remove or improve search result caching
### How
For a newly connected site, the cache stops requests to the search API getting the latest results because even when the site is not indexed yet, the empty result would still be cached for 5 minutes.
We could,
- Either not to cache empty results;
- Or just remove all caching.
I would recommend doing the latter. As of search, the hitting rate would be super low for individual users.
https://github.com/Automattic/jetpack/blob/e0d1c693475a20aa74cc938d93c5f0717e205e34/projects/packages/search/src/instant-search/lib/api.js#L360
Contributor guide
Research direction
Start at projects/packages/search/src/instant-search/lib/api.js around line 360 and inspect how search results are cached. Decide whether empty results should bypass caching or whether caching should be removed, with priority given to the stated recommendation. Done means a newly connected site can receive current search results instead of a cached empty response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- search
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100