Segmentation by Freshness

Martin Fowler’s “bliki” is often an interesting read. This recent article is very thought-provoking, offering a clever way to bridge the gap between fully dynamic and fully-static web pages.

In regular web development, there is a stark choice between marking a web page as fully dynamic (typically by adding a sprinkle of “don’t cache me” headers) and marking it as static and unchanging. Dynamic pages can bypass web-caches to provide up-to-the-minute information, but force the server to handle the load of every request from every user. Static pages gain the speed and scalability advantages from distributed caching but can fall foul of many problems including stale data and user-session-confusion.

Fowler proposes a technique of using separate HTTP requests controlled by JavaScript to fetch dynamic page fragments and merge them with the main, static, content.

The new bit about this is the solution of using JavaScript to fetch fragments and modify the HTML. The overall approach has been used successfully since the dawn of modern web browsers. – it’s very similar in concept to the way the old faithful “img” tag has always been handled.

MF Bliki: Segmentation by Freshness