Sjoerd Tieleman
2009-Jul-27 09:38 UTC
:expires_in not working with memcache/fragment caching?
Hi all, I''m using memcache (which support the :expires_in option) and I''m using it in a view to cache a certain piece of HTML, somewhat like: <% cache :expires_in => 10.minutes %> some HTML <% end %> Funny thing is that I can see in memcache that the key is being set: set views/localhost:3000/gids?expires_in=600 0 0 6619 However, as you can see the :expires_in is being passed as part of the key and not as the expiration flag in memcache (the second 0 should be 600). Is there anything I''m doing wrong here? Kind regards, Sjoerd Tieleman.
Sjoerd Tieleman
2009-Jul-27 09:54 UTC
Re: :expires_in not working with memcache/fragment caching?
Well, I''ve solved my own problem. You need to explicitly specify a key before you can supply any options. Otherwise the options will be added to the key. Kind regards, Sjoerd. On Jul 27, 11:38 am, Sjoerd Tieleman <tiele...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I''m using memcache (which support the :expires_in option) and I''m > using it in a view to cache a certain piece of HTML, somewhat like: > > <% cache :expires_in => 10.minutes %> > some HTML > <% end %> > > Funny thing is that I can see in memcache that the key is being set: > > set views/localhost:3000/gids?expires_in=600 0 0 6619 > > However, as you can see the :expires_in is being passed as part of the > key and not as the expiration flag in memcache (the second 0 should be > 600). > > Is there anything I''m doing wrong here? > > Kind regards, > > Sjoerd Tieleman.