Skip to content

Conversation

gibrown
Copy link
Member

@gibrown gibrown commented Oct 10, 2019

Just a simple 5 minute cache to start out. I was noticing that with starting and stopping filtering on other pages how slow and distracting it can feel to have to do that extra search request even though you just did the same search. Added some comments on some other cases to improve, but decided to try going simple.

bundle size before: 267902 Oct 10 17:54 jp-search.bundle.js
bundle size after: 305240 Oct 10 19:23 jp-search.bundle.js

Testing instructions:

  • Add define( "JETPACK_SEARCH_PROTOTYPE", true ); to your wp-config.php.
  • Ensure that your site has the Jetpack Pro plan and Jetpack Search enabled.
  • Add a Jetpack Search widget to the Search page sidebar and configure some filters.
  • Start searching and re-searching

@gibrown gibrown requested a review from a team October 10, 2019 19:31
@gibrown gibrown requested a review from jsnmoon October 10, 2019 19:32
@gibrown gibrown self-assigned this Oct 10, 2019
@gibrown gibrown added [Status] Needs Review This PR is ready for review. Instant Search [Feature] Search For all things related to Search labels Oct 10, 2019
Copy link
Contributor

@jsnmoon jsnmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable, but I think you might have nuked the yarn.lock file; let me see if I can fix that up.

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello gibrown! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D33893-code before merging this PR. Thank you!

@gibrown gibrown merged commit 614c0ab into instant-search-master Oct 10, 2019
@gibrown gibrown deleted the add/instant-search-cache branch October 10, 2019 23:14
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Needs Review This PR is ready for review. labels Oct 10, 2019
jsnmoon added a commit that referenced this pull request Oct 23, 2019
* Implement minimal search results and spelling correction (#13365)
* Add filtering display (#13371)
* Fix search result display bugs and make improvements (#13393)
* Add rudimentary support for filtering on post types (#13430)
* Add support for filtering on categories and tags (#13505)
* Add instant search sorting based on the URL (#13377)
* Add support for filtering on dates (#13545)
* Add custom taxonomy filtering (#13605)
* add sort widget (#13614)
* fix many theme incompatibilities (#13602)
* Add infinite scrolling (#13684)
* Add caching to the api requests (#13714)
* Clean up some design bugs/issues (#13721)
* Fix labels for post types when we have them. (#13750)
* Add localization and formatting of all dates (#13748)
* search from any page on the site (#13713)
* Hook up default options (inc. sort) (#13742)
* Add TrainTracks analytics (#13730)
* Create PostTypeIcon component (#13790)
* Upgrade to Preact 10 (#13794)
* Add comments component (#13797)
* Address review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Search For all things related to Search Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants