A while ago, I noticed a few web logs which indicated how long ago a post was published. It’s a neat idea, because it lets readers gauge a post’s freshness in a fairly straightforward manner. At the time, though I figured it had two disadvantages:
- It requires dynamic page creation in order for the page to indicate how old it is. That’s out of the question here at ZedneWeb, as all the pages are served statically.
- It modifies the pages even though they haven’t really changed. Among other things, this defeats caching. (Granted, web caches are something of an urban legend in the HTTP world, but it’s the principle that matters.)
Having concluded that I (a) couldn’t do it, and (b) shouldn’t do it, I went my merry way.
Until last night, when I suddenly realized I was wrong. My content manager puts a date on every ZedneWeb post, in the vain hope that it might prove useful to some content aggregator out there. Thus, I could write a script that would take that information, compare it to the current date, and insert a freshness statement into the page—and do it all in the browser.
For fun, I’ve also put a script on the monthly calendars which highlights the current day. It’s not useful, and I suspect no one will ever see it, but why not? If nothing else, the experience may come in handy some day.