Sam
2006-Aug-09 17:11 UTC
requestHeaders: [''cache-control'', ''no-cache'', ''pragma'', ''no-cache''],
Ajax.Request ... does requestHeaders: [''cache-control'',''no-cache'',''pragma'',''no-cache''], apply to both GET and PUT operations? Can I ensure a page I retrieve will not be cached by the browser using Ajax.Request, GET? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ryan Gahl
2006-Aug-09 18:30 UTC
Re: requestHeaders: [''cache-control'', ''no-cache'', ''pragma'', ''no-cache''],
One sure fire way to prevent caching is to include a cache buster in your request URL... var cacheBuster = "?" + new Date() * 1; var url = yourURL + cacheBuster; ...do Request... On 8/9/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> > Ajax.Request > > ... does > > requestHeaders: [''cache-control'',''no-cache'',''pragma'',''no-cache''], > apply to both GET and PUT operations? > > Can I ensure a page I retrieve will not be cached by the browser using > Ajax.Request, GET? > > Sam > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ryan Gahl
2006-Aug-09 18:32 UTC
Re: requestHeaders: [''cache-control'', ''no-cache'', ''pragma'', ''no-cache''],
...oops, this should be obvious, but replace the ? with a "&c=" (or something) if your url already contains other parameters... you''ll figure that part out I''m sure... On 8/9/06, Ryan Gahl <ryan.gahl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > One sure fire way to prevent caching is to include a cache buster in your > request URL... > > var cacheBuster = "?" + new Date() * 1; > var url = yourURL + cacheBuster; > > ...do Request... > > On 8/9/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: > > > Ajax.Request > > > > ... does > > > > requestHeaders: [''cache-control'',''no-cache'',''pragma'',''no-cache''], > > apply to both GET and PUT operations? > > > > Can I ensure a page I retrieve will not be cached by the browser using > > Ajax.Request, GET? > > > > Sam > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Sam
2006-Aug-12 13:47 UTC
RE: requestHeaders: [''cache-control'', ''no-cache'', ''pragma'', ''no-cache''],
Thanks for the suggestion. I''ll give it a try. Sam _____ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ryan Gahl Sent: Wednesday, August 09, 2006 2:31 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] requestHeaders: [''cache-control'', ''no-cache'',''pragma'', ''no-cache''], One sure fire way to prevent caching is to include a cache buster in your request URL... var cacheBuster = "?" + new Date() * 1; var url = yourURL + cacheBuster; ...do Request... On 8/9/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: Ajax.Request ... does requestHeaders: [''cache-control'',''no-cache'',''pragma'',''no-cache''], apply to both GET and PUT operations? Can I ensure a page I retrieve will not be cached by the browser using Ajax.Request, GET? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs