A new way to implement search in static websites?


TLDR: Index the content at build time, and deploy the index files and a program to process searches to Cloudflare workers


I had thought of participating in the Cloudflare Developer contest, but kept putting it off till the deadline and did not submit it. But this was my plan: to introduce a new way to implement search for static web sites. (Maybe this is not even new and people are already using it.)

We can use Tantivy to index the site and then push the index files and the Rust code to Cloudflare Workers. Also, Cloudflare Workers natively supports Rust. Since this is a static site, Cloudflare Workers will be re-deployed each time there is a change in content, but the index might not have to be rebuilt since I think that's what "Incremental indexing" means.


Related:


😂 Speaking of static sites, JAM-stack means "Just Attempt Moving off of our paid service". Credits: The Olognion

Another Olognion article: Dev recovered from COVID now prefers Material Design due to permanent loss of taste.

In both the above cases, the problem appears to be that people are overusing it. People are using Material Design libraries not just as a component library but as the entire UX design process.

If your static side needs forms, authentication, analytics, and payments, maybe it is better to not keep it as a JAM stack site using add-ons from your static site hosting provider, to get locked in.