I'm quite pleased by the tech architecture of my art website klauria.tech · 13 p...
HN Best 200 @best
I'm quite pleased by the tech architecture of my art website klauria.tech · 13 points · 1 comments · HN thread
TL;DR The author describes the architecture of their art website, which serves pages as static cached HTML from Cloudflare while still allowing dynamic editing through a CRUD UI. Each page is rendered on the server with a long cache header, uploads trigger invalidation of all cached pages, and images are downsampled in the browser at upload time and stored in Cloudflare R2. The post has no comments.
- Pages are rendered on a Cloudflare Worker from a single metadata JSON file in R2 and cached for 30 days at the CDN.
- Any write (new painting, tag change) invalidates all cached pages instead of only the affected ones, because dependencies between pages and metadata are not explicitly tracked.
- Three smaller image sizes are generated in the author's browser at upload time and stored alongside the archival originals in R2, since the author is the only uploader.
- Interactive maps and timelines run client-side and read the same JSON, with no database or server-side writes, though the timeline's bars are drawn on the server.
- Cost is near zero: compute and bandwidth are free for this traffic, and storage will only cost a few cents a month once it passes the 10 GB free tier.
- The site is built with Astro, which Cloudflare acquired, but the author notes the core idea needs only careful cache management, not a framework.
Discussion No comments have been posted on this story yet, so there is no discussion to summarize.
#staticSites #cloudflare #caching #webArchitecture #personalProjects