views:

167

answers:

1

I've found in this screencast ¹ that you can do, in Ruby in Rails, a better client caching ² considering REST + model for filling eTag. Way more smart than render all the http body and only after all this, calculate the eTag, as usual.

This property can make the client caching more model-oriented when using GET, so I think this is great for performance.

I didn't see anywhere someone making this with asp.net MVC. Would it be as easy as I saw this guy doing in Rails?

+1  A: 

eTags are an HTTP concept more than they are related to any one server-side technology. I believe RoR may make it easier when compared to IIS/MVC to indicate that a particular file is cached using an eTag.

For IIS/MVC, you have two options of setting up response headers (which can include eTag settings):

  1. In the IIS Content Expiration settings dialog.
  2. Setting up HTTP Handlers or a similar technique so that you specify exactly which response headers you want for a particular request. This is a programmatic variation of step #1. It is necessary if you're streaming database content over the wire, in which case there isn't a real file to speak of.

If there are other ways of making this happen that I haven't listed, I would love to know about them.

David Andres