I have downloaded the latest version of the plugin timed_fragment_cache. Which makes timed cache expiration possible in the filesystem. My first experiment was this: In my controller I have the following code: when_fragment_expired(''front_popular_races'', 10.minutes.ago) do @popular_races = Race.popular end And in the view: <% cache(''front_popular_races'') do %> <% for race in @popular_races %> <%= link_to race.name, ''/racehunde/'' + CGI::escape(race.name), :class => ''race'' %> <br> <% end %> <% end %> But the cached fragment file expires and gets regenerated on every request. What am I doing wrong? - Carsten -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you running in development mode? Did you set: config.action_controller.perform_caching = true in environments/development.rb Cheers, Nick. Carsten Gehling wrote:> I have downloaded the latest version of the plugin timed_fragment_cache. > Which makes timed cache expiration possible in the filesystem. > > My first experiment was this: > > > In my controller I have the following code: > > when_fragment_expired(''front_popular_races'', 10.minutes.ago) do > @popular_races = Race.popular > end > > > > And in the view: > > <% cache(''front_popular_races'') do %> > <% for race in @popular_races %> > <%= link_to race.name, ''/racehunde/'' + CGI::escape(race.name), > :class => ''race'' %> > <br> > <% end %> > <% end %> > > > But the cached fragment file expires and gets regenerated on every > request. What am I doing wrong? > > - Carsten-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nick Atkins wrote:> Are you running in development mode? Did you set: > > config.action_controller.perform_caching = true > > in environments/development.rbI was yes - this was an old question, but thanks for answering anyway :-) - Carsten -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, I am facing the same problem using timed_fragment_cache plugin. And do all the steps i need to do. it works fine for time being cache. But for the left all it not work it expires. Any Idea? Arun Agrawal Carsten Gehling wrote:> Nick Atkins wrote: >> Are you running in development mode? Did you set: >> >> config.action_controller.perform_caching = true >> >> in environments/development.rb > > I was yes - this was an old question, but thanks for answering anyway > :-) > > - Carsten-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Arun Agrawal wrote:> Hi, > > I am facing the same problem using timed_fragment_cache plugin. > And do all the steps i need to do. > it works fine for time being cache. > But for the left all it not work it expires.I ended up choosing another approach. I am using the normal cache system. Then I made a cronjob, that deletes the cache files after after a certain amount of time. - Carsten -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 31, 4:32 pm, Carsten Gehling <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Arun Agrawal wrote: > > Hi, > > > I am facing the same problem using timed_fragment_cache plugin. > > And do all the steps i need to do. > > it works fine for time being cache. > > But for the left all it not work it expires. > > I ended up choosing another approach. I am using the normal cache > system. Then I made a cronjob, that deletes the cache files after after > a certain amount of time. > > - Carsten > -- > Posted viahttp://www.ruby-forum.com/.Carsten, Just out of curiosity, Was that because of a limitation in the plugin or you just wanted a cron based solution? Are you using capistrano to setup that cron job? Cos otherwise it seems like another bit to configure unless of course the plugin didnt meet your requirements. Cheers, Aditya --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aditya wrote:> Carsten, Just out of curiosity, Was that because of a limitation in > the plugin or you just wanted a cron based solution? > Are you using capistrano to setup that cron job? Cos otherwise it > seems like another bit to configure unless of course the plugin didnt > meet your requirements.Oh it was simply, that I never succeded in getting the fragments to time-out and be rebuilt. After using 2 days on it, I had to quickly find another solution. Our site was suddenly having a LOT of requests due to a TV commercial so I just had to get some cache to work quickly. - Carsten -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Just a question on the original code. Shouldn''t the line when_fragment_expired(''front_popular_races'', 10.minutes.ago) do be when_fragment_expired(''front_popular_races'', 10.minutes.from_now) do ? Perhaps that''s the reason why the cache always expires. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---