HTTP Cache

I finally decided to insert some HTTP Cache in my app (besides Rails default e-tag) and found one nice plugin:

http://josevalim.blogspot.com/2008/06/easy-http-cache.html

It gives me all tools to manipulate cache headers just declaring it in my Controller.

GitHub here:

http://github.com/josevalim/easy-http-cache/tree/master

Just wondering, any chance of such feature enter into edge?

Regards, Daniel Cursino.

<quote who="Daniel Cursino">

I finally decided to insert some HTTP Cache in my app (besides Rails default e-tag) and found one nice plugin:

http://josevalim.blogspot.com/2008/06/easy-http-cache.html

It gives me all tools to manipulate cache headers just declaring it in my Controller.

Just curious but what's wrong with the "expires_in" (ActionController::Base) Rails method?

expires_in is just a small use case of HTTP Cache mechanisms.

The plugin supports :etag and :last_modified_at options besides :expires_in. In those cases, you can also send a Proc or an Array, allowing better and dynamic cache validation/expiration.

Second, if I want to cache several pages, it's better the declarative style on the top of my controller:

  http_cache :index, :show, :list, :common_options =>...

And it's more DRY in comparison with setting expires_in in all actions.

I hope that proves my point! =) Daniel.