By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

FAQ Topic - How do I force a reload from the server/prevent caching? (2008-05-02)

P: n/a
-----------------------------------------------------------------------
FAQ Topic - How do I force a reload from the server/prevent
caching?
-----------------------------------------------------------------------

To reload a page, use location.reload(). However, this depends
upon the cache headers that your server sends. To change this,
you need to alter the server configuration. A quick fix on the
client is to change the page URI so that it contains a unique
element, such as the current time. For example:
` location.replace(location.href+'?d='+new Date().valueOf()) `
If the location.href already contains a Query String, use:
` location.replace(location.href+'&d='+new Date().valueOf()) `

http://www.mnot.net/cache_docs/

http://docs.sun.com/source/816-6408-10/date.htm
--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ugo
-----------------------------------------------------------------------
FAQ Topic - How do I force a reload from the server/prevent
caching?
-----------------------------------------------------------------------
Excuse me, but is not sufficent loaction.reload(true)?
http://docs.sun.com/source/816-6408-...on.htm#1194198
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.