Deep Etags

March 24, 2007

Joe Gregorio writes about “Deep ETags”, i.e. creating an etag value (which is (one of the factors) used to control HTTP caching) as “low” as possible. I’ve wondered about this a few days ago, and checked the Rails sources — Etag support has been added just recently:

Added that rendering will automatically insert the etag header on 200 OK responses. The etag is calculated using MD5 of the response body. If a request comes in that has a matching etag, the response will be changed to a 304 Not Modified and the response body will be set to an empty string.

So Rails does etags, which is good, but I believe it could offer much better support if this was connected to the lower layers (i.e. ActiveRecord). Should be easy to do …

About

This page contains a single entry from Stefan Tilkov's Random Stuff posted on March 24, 2007 10:54 PM. The previous post in this blog was lift: Rails-like Web framework for Scala. The next post in this blog is Erlang. Many more can be found on the main index page or by looking through the archives.

Comments