PDA

View Full Version : Force the client to fetch the files from server



nikhilkrishnan
14 Jul 2010, 10:40 PM
Hi,

We are working on project using extjs and and we need to frequently update the ext files. Even if after uploding the files to server its takes a lot time to reflect. Some times pressing Ctrl+F5 resolves the issue but some times it just shows the old files.

I have searched some forums and found that passing a version number while calling the js file may resolve the issue,
but its not practical for us, as we have a number of PHP file and js files .So its not practical to go through all the files and change the linking part.

Another solution that i have found is ton include following PHP coding

<?
header("Pragma: no-cache");
header("Cache: no-cahce");
?>Is there any other ways to resolve this issue.

Thanks
Nikhil

Condor
14 Jul 2010, 11:03 PM
Our server automatically uses ETags to 'version' the files. This works well for everything but stylesheets.

For stylesheets you'll have to use something like:

<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css?version=123" />