Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minisearch webworker is terminated on page reloads #96

Open
eric-wieser opened this issue Nov 16, 2020 · 1 comment
Open

minisearch webworker is terminated on page reloads #96

eric-wieser opened this issue Nov 16, 2020 · 1 comment

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Nov 16, 2020

I've found the startup time for the search to be very painful, especially since when I click a search result and find its the wrong one, I have to start all over again waiting for it to load.

What's happening here is that the SharedWorker is being killed by chrome, because at the point I click the link there are no mathlib_docs tabs open with a search connection to keep it alive.

As a workaround, I can just open an extra tab and start a search in it, which is enough to keep the search alive. Better solutions might be to:

@eric-wieser eric-wieser changed the title minisearch webworker is terminates on page reloads minisearch webworker is terminated on page reloads Nov 16, 2020
@eric-wieser
Copy link
Member Author

One option for improving this would be to :

  • use miniSearch.toJSON() to export the complete index after constructing it for the first time
  • put it in localStorage
  • next tmie a page is loaded, try using MiniSearch.fromJS(the_json_from_local_storage), which would bypass the long startup times

We'd need to make sure there's some mechanism to invalidate that cache when the docs site updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant