3 ms·
Would also be great to add (efficient) search to a static blog.
by tyingq 6y ago
Would also be great to add (efficient) search to a static blog.
- edoceo 6y agoyea, sqlite FTS5 has been pretty amazing for quick search solutions (but I use english only)
- nanna 6y agoDefinitely. Just need to add a layer to the static site generator for it to populate the SQLite DB, right?
- intergalplan 6y agoI'd also version the DB in the URL, else you could end up changing the file out from under someone who's already got the page loaded, with who-knows-what results depending on how different the file is. You could just prefix a head to every range request to check for changes, but that adds overhead and doesn't actually completely close the gap, so it'd still be possible to read a file different from the one you intended. Cost is more disk usage, depending on how many copies you keep around, but at least keeping the most recent "old" version seems reasonable unless you're skating really close to the quota on whatever system you're using.
- M2Ys4U 6y agoRequests could use the If-Unmodified-Since header to guard against DB changes without the overhead of a separate HEAD request. If the underlying DB has been changed then the server should respond with 412 Precondition Failed.