Re: reason for action_cache before_filter?

Gustav Paul
Sun, 26 Nov 2006 09:58:54 -0000

Hi Tom

I checked out your plugin and it is excellent! The bottom code is the
part that let''s you assign custom keys?

ActionController::Caching::Actions::ActionCacheFilter.fragment_key Proc.new
{|controller|

"AC:#{controller.request.host_with_port}:#{controller.params.sort.join('':'').gsub(''
'', ''-'')}"
}

Obviously the developer can make the block more interesting as he''s got
access to the controller object etc. (but you wrote it, so you know :] )

The only thing I prefer about my plugin is the syntax, but perhaps I can
integrate it with your plugin so mine acts as a simpler wrapper. From
looking at your plugin, it seems like mine will already wrap yours with
no modifications to either! I only modify ActionCachePath, and add a
class method and class variable to ActionController...none of which look
like they intrude upon your work. If you don''t mind, I''ll run
both on
the same project for a while and let you know how it goes.

Thanks for your great work dude! Its really excellent! In short, my
plugin doesn''t mod action_cache in any way that interferes with yours,
so if your plugin is installed on the same project, I''m pretty sure
mine
will make full use of it, giving the best of both to the developer.

But like I said, I''ll be trying them out in parallel and see if they
can
enjoy a symbiotic relationship.

I still haven''t uploaded mine to rubyforge, but the moment I do
I''ll be
sure to let you know(if you''re interested in the least :] )

Cheery-o
Gustav Paul
gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org



Tom Fakes wrote:
> My action_cache plugin already allows this type of behavior, in a
> different way.
>
> I''ve used it in an app to cache for ''admin'',
''logged in user'' and ''not
> logged in user'', and my site uses themes, so the theme name is
also
> part of the cache key.  It is configurable to allow any available
> setting to be used to influence the cache.
>
> Check it my blog postings (http://blog.craz8.com/) for details,
> script\plugin install action_cache will get the latest code.
>
> My plugin also fixes some bugs in Rails action_cache, and does stuff
> like return 304s for unchanged content.  The latest version can also
> use the x-sendfile header in lighttpd and x-accel-redirect in nginx to
> further reduce overhead.
>
>
> >
>
>