I''m working on an app that''s basically forms and that makes fairly heavy use of Ajax. As a result of the Ajax usage, if the visitor uses the back button they get the page as it was originally loaded, not as they left it. I''ve looked at the Sweeper documentation and can not tell for sure that it''ll do what I want, which is to force an unconditional reload from the server when the visitor uses the Back button. Anybody got any experience with Sweepers they''d be willing to share? Thanks in advance, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails/attachments/20060712/fcdccc2e/attachment.html
Hi Bill, I don''t know about Sweepers. Where is the documentation? I asked similar questions about controlling the back button and history on comp.lang.javascript. It seems like this is not possible for security reasons. groups.google.com/group/comp.lang.javascript/browse_thread/thread/690e8d53fc9a593e?hl=en Peter On 7/12/06, Bill Walton <bill.walton@charter.net> wrote:> > > I''m working on an app that''s basically forms and that makes fairly heavy use > of Ajax. As a result of the Ajax usage, if the visitor uses the back button > they get the page as it was originally loaded, not as they left it. I''ve > looked at the Sweeper documentation and can not tell for sure that it''ll do > what I want, which is to force an unconditional reload from the server when > the visitor uses the Back button. Anybody got any experience with Sweepers > they''d be willing to share? > > Thanks in advance, > Bill > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails > > >
Hi Peter, Peter Michaux wrote:> I don''t know about Sweepers. Where is the documentation?api.rubyonrails.org in the ActionController::Caching::Sweepers Class.> I asked similar questions about controlling the back button and > history on comp.lang.javascript. It seems like this is not possible > for security reasons.My reading is that about all you can do with history is to remove an entry to make sure the visitor can''t get there via the Back button. Not at all what I want. It looks like the answer involves, at a minimum, setting the response headers correctly. According to the W3C RFC 2616 document, the Cache-Control header is the one that controls caching on the client (and intermediate proxies). It says... " If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server." All the error pages I get from Rails have a Response section at the bottom with a line that reads ''Headers: {"cookie" =>[], "Cache-Control"=> "no-cache"}''. So I''m guessing / hoping that a Sweeper expires the version on the server and so, when the client does the ''revalidation with the origin server'', forces a reload. There also seems to be the option of just expiring fields instead of the entire page. That would be ideal. So I''m hoping someone who''s worked with Sweepers will see this and maybe help me understand what I need to do. Anybody? Best regards, Bill
Hoping somebody might help save me a few days here... ;-) My little app depends heavily on RJS. Visitors using the back button see the page that originally loaded, not the one s they left it According to the W3C RFC 2616 document, the Cache-Control header is the one that controls caching on the client (and intermediate proxies). It says... " If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server." All the error pages I get from Rails have a Response section at the bottom with a line that reads ''Headers: {"cookie" =>[], "Cache-Control"=> "no-cache"}''. So I''m guessing / hoping that a Sweeper expires the version on the server and so, when the client does the ''revalidation with the origin server'', forces a reload. There also seems to be the option of just expiring fields instead of the entire page. That would be ideal. But, of course, the documentation is a little sparse ;-) So I''m hoping someone who''s worked with Sweepers will see this and maybe help me understand what I need to do. Anybody? Best regards, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails/attachments/20060713/be6f65c7/attachment.html