Forum: Rails-core (closed, excessive spam) HTTP Cache

Posted by Daniel Cursino (Guest)
on 2008-06-09 11:20
(Received via mailing list)
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.
Posted by Lisa Seelye (Guest)
on 2008-06-09 13:31
(Received via mailing list)
<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?


--
Regards,
-Lisa
http://www.crudvision.com
Posted by Daniel Cursino (Guest)
on 2008-06-09 14:48
(Received via mailing list)
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.
This topic is locked and can not be replied to.