-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Search: caching for faster startup #5391
Comments
Thanks for suggesting! We're currently reworking the search implementation to be much more powerful that what we currently have in place. Caching is something we'll also be investigating. In the meantime, you can use instant loading, which means you will only pay the cost of index initialization on the first request. |
If I understand #2976 correctly, the prebuilt search index will be removed in the next iteration of the search functionality. One of the strengths of Material for MkDocs thus far has been its support for offline usage. Will the caching mechanism proposed here (or the instant loading workaround) support the offline use case with the new search features? |
The prebuilt index was removed in Material for MkDocs 8 1,5 years ago. Offline search already works pretty well, and the new search will definitely continue to do so. We'll investigate caching on Instant loading does not work on |
Please see the announcement in #6307. |
Context
In our docs, it takes about 5 seconds for the search plugin to become ready.
Description
Currently, the search index input is requested and indexed on every page load. Instead, the final search index could be kept in local browser storage and loaded from there if the search index input can be determined to be the same.
Related links
Use Cases
The user would need to provide a version identifier (e.g. git SHA, release number) that will be used as the cache key. Alternatively, material could compute a hash of the docs itself, though I'm not sure how realistic that is.
The advantages would be reduced bandwidth usage and less delay until the search plugin is ready.
Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: