Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
search: be prepared for the transition from the Rails app
We are in the process of moving over https://git-scm.com/ from a Rails app to a Hugo/Pagefind-based site that is hosted on GitHub Pages. Our first attempt on September 20th, 2024, revealed that there are challenges with cached pages, both browser cache and Cloudflare cache adding their own quirks. The most obvious problem was that _some_ cached URL contents seem to be lagging behind from the Rails app while new ones from the static Hugo site are added. To help with this, I added code in the parent commit to let the the Hugo site keep offering the `.css` and `.js` files of the Rails app. That way, a previously-cached version of, say, https://git-scm.com/docs/git would still find the referenced style sheets and Javascript files. For the same reason, this here commit prepares the `/search` page to be able to deal with being called when `window.location` points to `/assets/application-<some-hex>.js`, which is the case when the Hugo/Pagefind version of `/search?term=<needle>` is called from a Rails version of the interactive search box. According to the `Cache-control:` header sent back by the Rails app, the `max-age` is set to 14,400 seconds, i.e. 4 hours, therefore the transition window should be relatively manageable. Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information