pagefind icon indicating copy to clipboard operation
pagefind copied to clipboard

Support for fully offline search like PWAs

Open geshan opened this issue 1 year ago • 7 comments

Pagefind is a great project and a boon to static/JAM stack websites.

I run a blog that is also a Progressive Web Application (PWA) and I thought as page find is fully client side it would work offline for a PWA. Unfortunately, that was not the case, the main blocker I found was the metadata timestamp call. I have made sure that all the .pf_fragment, .pf_index, .pagefind, pf_meta files are cached by the service worker, still when the server is not there, the /_pagefind/pagefind.pf_meta?ts={current-ts} fails and the search fails too. Is there a way to also be cached by the service worker so that the search works offline? May be not the latest index but whatever was cached. I may be oversimplifying it.

Patch fix

If I force remove the ?ts={current-ts} it kinda works fully offline, is there a way to remove it with a flag or something?

geshan avatar Aug 18 '22 10:08 geshan