Hi, My server is sending these headers post-check=0, must-revalidate, no-store, no-cache, pre-check=0 Currently, i am caching gif images and css files. Only problem i see is that each time when i load my website it saves css file again the cache with new expiry date, that means it is not loading it from cache Initially i went to my home page and saw temporary internet file that said expiry date of my css is 1/3/2007 2:04 PM. After five minutes i refreshed my page again and the expiry date of my css was 1/3/2007 2:09 PM Please advice how can change my headers in htaccess so that each time the site opens it check if my css file is modified or not..If it was modified before the expiry then update the css file in cache otherwise just use the one in the cache
Since it is not the default to have a response header that kills cache (it causes extra load on the server), your source must contain a header function. This is common where dynamic pages are involved. After all, you want the user to see the current version rather than something they've cached. Look at the document source for a line or lines similar to <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?> Code (markup): This is PHP, but other languages will have something that does the same. RTFM for your language. If your documents do not contain header function(s) and your browser (IE wrongly allows server response headers to be ignored) is properly configured, you will need to contact your sysadmin. (Don't make yourself look bad if other pages don't have a no-cache instruction.) cheers, gary
Yes, i have a dyamic page but css and js script file hardly change. So what i exactly want is the header code, that checks for those css and js file, if they have been modified since last access time... If modified then copy the new file from the cache otherwise use it from the cache what do you suggest
In Firefox, open the css and js documents. Using the webdevelopers extension, view the server response headers. There is no sane reason for them to have a no-cache rule. You can also use the Gnu utility wget, as ~$ wget -S --spider or in DOS, C:\ > wget -S --spider ...r, talk to your sys-admin. cheers, gary