View Full Version : js file caching
LouiseB
09-02-2005, 09:35/09:35AM
Hello,
My menu and product prices/status are located in js files. When I update them and upload them to my site it sometimes take up to a couple of hours for the information to be updated.
I understand there is some sort of code I can put in my pages that keeps the js files completely uptodate. Does anyone know how I can do this please?
Any help would be great.
thanks
Louise
ihelpyou
09-02-2005, 10:00/10:00AM
I don't know what you mean. If you change "anything" at all in your site and on your server, the change is updated immediately. If not, you are on a screwed up server. :)
LouiseB
09-02-2005, 10:33/10:33AM
It has only become a problem in the last month or so. I change something on the page, upload it and it updates straight away, i change something in the js file, upload it and it takes about an hour or so till it is visible.
Louise
Connie
09-02-2005, 11:21/11:21AM
Is the js in an external file? If so it might be a browser catching issue. Maybe :confused:
polarmate
09-02-2005, 11:27/11:27AM
Connie is right,. It's your browser that is caching the external js file. Anything on the page is refreshed as the browser gets the 'page changed' status and therefore gets the entire page.
If you are testing using IE, you can use the option of getting the file every time instead of pullin git from the cache by doing this:
Tools | Internet Options
In the General Tab, under Temporary Internet files, click on 'Settings'
Select 'Every visit to the page' under Check for newer versions of stored pages
Turn this off when you're surfing or not testing as it can be quite painful as every image, every object will be downloaded for every page you visit - whether on your site or any other site.
LouiseB
09-02-2005, 11:36/11:36AM
Hello,
I agree it is a caching issue - I have the 'every visit to page' option ticked, still no joy. This is why i have investigated about putting a time on the js file - as I understand it you can add something after the name of the file starting with a ? and everytime the page is loaded it checks for the latest version of the file.
Very curious, I have just updated some stock status details and all worked straight away!!!!
Thank you for all your feedback, perhaps this was just a temporary gliche with something at the hosting firm!
Murphys law springs to mind.
Louise
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.