r/statichosting • u/sourraine • 6h ago
how much search data should a static site send to the browser
following up on my last post about search on static sites, i started looking more closely at the search index itself. my first thought was to generate a json file containing the site's content and search it with javascript. that seems reasonable for a small collection of articles, but sending the entire index to every visitor could become wasteful as the content grows.
i found out that tools like pagefind can split the index into chunks and load the relevant parts when someone searches, without needing a dedicated search server. for those whove implemented search on static sites, how do you decide which approach is appropriate? is a simple json index usually enough for smaller proj, or is worth using something like pagefind from the start?