Hacker News new | ask | show | jobs
by articulatepang 7 days ago
Yes, pages are rendered on the server the first time someone visits them, then cached ~forever until the next time I change something. So it has the cost and performance characteristics of a static site.
1 comments

Can I ask why your server-side code needs to be significantly slower than loading bytes from disk?
It’s because each page has content from several pieces.

For example, here’s everything tagged Utah: https://klauria.art/tag/utah

That page is built by reading a json of all pieces and collecting the ones tagged Utah.

Another example: the page for each piece links to other related pieces: the ones nearby in space, and nearby in time. Scroll to the bottom of https://klauria.art/piece/2026-08-29-fossek-farm to see the timeline and map.

That’s also generated by the server-side code reading the json.

So the source data for the website is the json + image files, and the pages themselves are build artifacts generated from the source. Any time I edit something, what’s actually happening is some change to the json and maybe the images.

So yes, this could be a static site where every page is rebuilt on my machine. Then the server side code would just be sending bytes from disk. But I wanted a nice CRUD UI for editing stuff. Hence the little cache dance.

Are they hard to compute because you're doing an O(N^2) closest-points thing? Or because you're parsing a giant JSON file on every page load? Or something else?