hn.today

I'm quite pleased by the tech architecture of my art website

klauria.tech174 points35 comments
Screenshot of I'm quite pleased by the tech architecture of my art website

The site presents paintings and sketchbook pages on a map, with tags and other ways to browse them. Its creator wanted visitors to get the speed and simplicity of a static site, while still having a convenient web interface for adding work and editing metadata. The solution uses a Cloudflare Worker to render HTML from a single JSON file stored in R2. Responses are cached at Cloudflare’s edge for up to 30 days, so most visitors receive ready-made pages rather than triggering fresh rendering. When the artist changes content through the editing interface, the system clears the cached pages. At upload time, the artist’s browser also creates smaller image versions for thumbnails and cards, avoiding slow delivery of full-resolution scans and the need for on-demand resizing.

Maps, timelines, and other interactive views run in the browser and use the same metadata, without requiring a database or sending edits back to a server. Some elements are partly rendered on the server before client-side interaction. The design favors simplicity and correctness over selective cache updates: although a change might affect only a few pages, tracking every page’s dependencies could leave the site inconsistently updated if done incorrectly. Invalidating everything is acceptable because changes are infrequent and the site has little traffic. The author describes the setup as inexpensive and fast, with Astro providing a convenient framework but not being essential to the approach.

Read on klauria.tech35 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Big Data Is Dead

Big Data Is Dead

Big data is not the main obstacle to useful insights: hardware has kept pace with data growth, while teams still struggle to make sense of their information. The author argues that organizations should focus on making data easier to understand and use, rather than buying tools built for ever-larger datasets. (motherduck.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.