Tuesday, June 30, 2026

Hit Publish, See It Live: How This Site Updates Instantly

Close-up of code on a computer screen

This site is statically rendered. Pages are built ahead of time and served as fast, cached HTML from the edge. That usually comes with a catch: change something in the CMS and you wait for a full rebuild, or you wait out a cache timer, before anyone sees it. This site doesn't make you wait. Publish in Agility and the change is live in seconds, on the specific pages that changed, without rebuilding the whole site.

Here's how that trick works.

Cache what you can, tag what you cache

Every piece of content the site fetches is cached and labelled with tags—this post carries a tag, the list of posts carries a tag, each locale's sitemap carries its own tag. Serving a page costs almost nothing because it's reading from cache, not calling the CMS on every request.

The tags are the important part. They turn the cache from an all-or-nothing timer into something you can clear surgically.

Publishing sends a signal

When you publish, approve, or unpublish something in Agility, it calls a webhook on this site. The site reads what changed and clears exactly the tags affected: the content item, the lists it appears in, and the page path it renders at. The next visitor regenerates just those pages against fresh content. Everything else stays cached and fast.

It's the difference between reprinting one page of a book and reprinting the whole book because you fixed a typo.

The sitemap is part of the deal

One subtlety took some care to get right. A blog post isn't only a page—it's also an entry in the sitemap, and the sitemap drives navigation, the listing, and the language switcher. So when a post is published, renamed, or removed, clearing the post's own cache isn't enough; the sitemap cache has to be cleared too, or a new post would be invisible and a deleted one would linger as a broken link.

The webhook handles all three cases—publish, unpublish, and delete—and clears the sitemap tags whenever a page or a dynamic page item changes. That's why a freshly published post shows up in the right place immediately, in the right language, instead of an hour later.

Fast and fresh, not fast or fresh

Most setups make you pick: static and fast but stale, or dynamic and fresh but slow. Tag-based, on-demand revalidation is how you get both. The page you're reading was served from cache in milliseconds. The moment its content changes, that cache is invalidated on purpose, and only where it matters.

If you have edit access, change a word and republish. By the time you reload, it's already here.