I’m using GhostHunter to search my blog. However, I imported a lot of content and this left the process slow, since everything is stored in the localStorage, which makes it very impractical. Any solution for this?
Update: Instead of loading all content and saving in localStorage, I am storing only the title. This solution reduced the problem by 60%, but not completely.
@Matheus_Clemente you may want to check out this topic for a possible Algolia search alternative, you can also vote on the feature
I could not implement. Can you help me?
Re ghostHunter, I’m afraid I’m responsible for the pull request that invokes localStorage. Using localStorage as a cache speeds up the index rebuild on subsequent visits to the page, but if you have frequent additions to the blog (and if the total volume of text is large), each update will trigger a full rebuild for all visitors, and that will come to feel laggy at some point – but with the version of lunr.js currently used, that’s unavoidable. IIRC, there has been some movement toward support for joining index objects in lunr.js. That might provide a means of retaining a large chunk of the cached index data between updates – someone would need to study recent developments chez lunr.js, and work out how to adapt GH to use that facility, if it is available. (Apologies that I don’t have time to do that work myself, but that might be a pathway to further improvement.)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.