Etag / Last-Modified headers


One question that has been bugging me about Typo for a while now is:
does Typo emit Etag or Last-Modified HTTP headers, suitable for web
caches to use? This is particularly important for the oft-requested

Today I finally took the time to find out. The answer seems to be
that Typo doesn’t emit either of these headers.

So, the obvious next question is: how hard is it to add one of these
headers? And what about the corresponding conditional GET?

Dan K.'s REST controller for rails (
rails/rest_controller.rb) looks to provide a leg-up, but we still
need to calculate the actual header ETag and Last-Modified values.
These need to be set as instance variables in the XML controller.
Could the *_feed.rxml views be used to set these? In particular it
looks like the Last-Modified value could be set from prettymuch the
same value used for the Atom “updated” field (ie
@items.first.updated_at.xmlschema) - a fairly low impact change I
would think? ETag might need something a big more sophisticated…

This is obviously not very well thought through, but are there any
initial reactions?

File a bug, and I’ll look at it when I can. Last-modified is easy
enough, we’ll just add it to our cache code. I’m not sure about