[thelist] +AFs-thelist+AF0- How to avoid caching javascript vars

Andres Mercader AMercader at Counterp.Com
Tue Jun 27 03:34:31 CDT 2006


So if I generate the same javascript code from a php script it will
force the browser to pick up the new values everytime? that sounds easy
enough,
will try+ACE- 

The expiry date that you mention, would it be something like 

meta http-equiv+AD0AIg-expires+ACI- content+AD0AIg-Wed, 26 Feb 1997 08:21:57 GMT+ACI- ?

thanks

+AD4APgA+-

Message: 9
Date: Mon, 26 Jun 2006 15:01:44 +-0100
From: +ACI-Christian Heilmann+ACI- +ADw-codepo8+AEA-gmail.com+AD4-
Subject: Re: +AFs-thelist+AF0- How to avoid caching javascript vars
To: +ACI-thelist+AEA-lists.evolt.org+ACI- +ADw-thelist+AEA-lists.evolt.org+AD4-
Message-ID:
	+ADw-30bd6ffd0606260701m4fd02822ua5ad80214ec65ba7+AEA-mail.gmail.com+AD4-
Content-Type: text/plain+ADs- charset+AD0-ISO-8859-1+ADs- format+AD0-flowed

+AD4- My question is, how can I make sure that the browser will not use any
+AD4- pre-cached value of these variables, and that it will always load the
+AD4- correct picture? Whenever I make any changes to those I need to reload
+AD4- the page
+AD4- a few times or even close the browser and reopen it again. In one
+AD4- occasion
+AD4- IE made me even restart my computer to notice the changes.

Here are some tips that helped me +AF8-a lot+AF8- when it comes to galleries

1) Don't rely on filenames
2) If you can, use the server to read and define the number of images
(read the folder content, filter out anything but jpg+AHw-gif+AHw-png - voila
- list of images)
3) IE +- caching +AD0- urgh (for example with some proxies MSIE will not
trigger imageObject.onload once it has been cached - you need a
bespoke property to test instead).

If you still want to go this route, create the JavaScript via PHP (by
writing it out and preceeding it with a JS header and a expiry date in
the past).




-- 
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/

-- 

+ACo- +ACo- Please support the community that supports you.  +ACo- +ACo-
http://evolt.org/help+AF8-support+AF8-evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt +ACE- 






More information about the thelist mailing list