Forum: Rails Spinoffs (closed, excessive spam) requestHeaders: ['cache-control', 'no-cache', 'pragma', 'no-

Posted by Sam (Guest)
on 2006-08-10 00:35
(Received via mailing list)
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
Posted by Ryan Gahl (Guest)
on 2006-08-10 02:26
(Received via mailing list)
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...
Posted by Sam (Guest)
on 2006-08-15 14:18
(Received via mailing list)
Thanks for the suggestion. I'll give it a try.

Sam


  _____

From: rails-spinoffs-bounces@lists.rubyonrails.org
[mailto:rails-spinoffs-bounces@lists.rubyonrails.org] On Behalf Of Ryan 
Gahl
Sent: Wednesday, August 09, 2006 2:31 PM
To: rails-spinoffs@lists.rubyonrails.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@iness.com> 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
Posted by Ryan Gahl (Guest)
on 2006-08-15 14:19
(Received via mailing list)
...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...
This topic is locked and can not be replied to.