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

'SearchinGhost_index' 'setItem' on 'Storage exceeded the quota #10

Open
Luen opened this issue Jan 21, 2021 · 4 comments
Open

'SearchinGhost_index' 'setItem' on 'Storage exceeded the quota #10

Luen opened this issue Jan 21, 2021 · 4 comments

Comments

@Luen
Copy link

Luen commented Jan 21, 2021

I get the follow error in console when using the search:
Unable to fetch Ghost data.
DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of 'SearchinGhost_index' exceeded the quota.
at https://cdn.jsdelivr.net/npm/searchinghost@1.6.2/dist/searchinghost.min.js:2:25425

The search still works currently though, albeit slow.
I believe the search worked originally without a console error when I installed it months ago.
Maybe it's because there are now 260 posts?

@gmfmi
Copy link
Owner

gmfmi commented Feb 9, 2021

Hi @Luen, sorry for the late reply, did not get any notification.

Yes, that's it. The total amount of space taken by your posts exceed the allowed capacity of browsers local storage. SearchinGhost still do its best to work but cannot rely on the cache mecanism anymore.

Now, you have 2 mains options:

  1. Stop using a full-text research, only use title and tags (see reference), downside: searches accuracy decrease
  2. Continue that way, downside: while the index is not fully indexed, search will be laggy

@gmfmi
Copy link
Owner

gmfmi commented Feb 9, 2021

While writing the previous comment, I though about it twice and maybe I should rewrite the cache mechanism.

I tested with my own blog data and currently I store the built index instead of the raw posts data. The goal was to limite JS processing when loading already downloaded data from the cache... but it's 3,46 times heavier !

So maybe, I should store the original posts and rebuild the index on search. Or I should maybe stop using the local storage and switch to IndexedDB or any other technology with higher storage quotas.

I do not have enough time right now to work on that but that might be an interesting feature. I'll leave the issue open as a reminder 😄

@Luen
Copy link
Author

Luen commented Feb 10, 2021

Great! Thank you for your in depth reply and possible solutions. searchinGhost is amazing, so thank you for all the work you've done on it.

@honzabilek4
Copy link

I think using IndexedDB would be much better idea (we can fallback to localStorage if IndexedDB is not supported)
For example in Safari the storage quota is really low. from what I've tested it's just ~2MB, breaking the whole search effectively even with not much data.

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

3 participants