Hi guys: i got a problem on caching my pages: in my Sweeper i wrote: -------------------------------- class MySweeper < ActionController::Caching::Sweeper observe Post def after_save(post) expire_page(:controller => ''post'', :action => ''show'', :id => post.id) cache_page(:controller => ''post'', :action => ''show'', :id => post.id) end end ---------------------------------------- The problem is ''cache_page'' NOT work while the ''expire_page'' works fine: when i open the url: /post/show/id , a cache page is created in public/ post/show/ folder. then i edit the post, the cache page was cleared by the sweeper, but it does not be created until i reopen the show page url in brower. this problem occured in my controller too ... any help idea? or i just misunderstand the ''cache_page'' method? thanks for help -- shawn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
shawn shao wrote:> The problem is ''cache_page'' NOT work while the ''expire_page'' works > fine: > when i open the url: /post/show/id , a cache page is created in public/ > post/show/ folder. > then i edit the post, the cache page was cleared by the sweeper, but > it does not be created until i reopen the show page url in brower. > this problem occured in my controller too ... > > any help idea? or i just misunderstand the ''cache_page'' method? > > thanks for help > -- shawnThe cache is only created when the acutla page is rendered again... it works as intended... -- 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 -~----------~----~----~----~------~----~------~--~---
Mikkel wrote:> > The cache is only created when the acutla page is rendered again... > > it works as intended...Thanks for reply, Mikkel~~ so is there any way i can generate a cache page without rendering the url page, Or can i ''pretend'' rendering it after save() action in my controller? -- 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 01 Jun 2007, at 12:41, Shawn Shao wrote:> so is there any way i can generate a cache page without rendering the > url page, > Or can i ''pretend'' rendering it after save() action in my controller?Although I would advise against it, you could issue a "curl "+url_for (...)+" > /dev/null" using ruby''s system command to load the page. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---