feat: introduce a text compress for search function
Summary
The search INDEX we store in localStorage, and it has the limitation about 5M.
And we discussed about the Indexed DB and other solutions couple years ago.
Today, a sudden inspiration struck me: instead of switching the persistence layer, we can use text compression to address our retrieval needs.
So I have found some implementations of text compression algorithms,and pick the suitable one of LZW lz-string since we are more on the content/docs.
Have a test based on our site docs, it reduces the 80% cost.
In short term, it could be a chance for users to make search still works when their docs big but not that too much.
As-is
Enable compress
Related issue, if any:
What kind of change does this PR introduce?
Feature
For any code change,
- [x] Related documentation has been updated, if needed
- [ ] Related tests have been added or updated, if needed
Does this PR introduce a breaking change?
Yes No
No
Tested in the following browsers:
- [x] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Edge
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docsify-preview | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 13, 2024 0:31am |
closed via #2464 .