Mobile app version of vmapp.org
Login or Join
Cooney921

: How to force browsers to always reload xslt files? Related: Apache: How can I force the browser to reload CSS files? I'm building an xml page (on an apache2) that is supposed to be translated

@Cooney921

Posted in: #Apache2 #Browsers #Css

Related: Apache: How can I force the browser to reload CSS files?

I'm building an xml page (on an apache2) that is supposed to be translated to xhtml by the browser, so my server also serves a main.xslt which is used as stylesheet by the xml file, similar to the scenario with the css files in the linked question.

However, none of tricks provided in either that answer, nor some issues on SO solve the issue for Opera. While Firefox responds to F5 by fetching not only the xml file but also the xslt file, Opera only reloads the xml file. I tried both, setting the Last-Modified HTTP header via an .htaccess file and using the expires module of apache2.

This is what my .htaccess looks right now:

AddType text/xsl;charset=utf-8 .xslt
ExpiresByType text/xsl "modification plus 1 second"
Header set Last-Modified "Wed, 08 Jan 2000 23:11:55 GMT" #Header set Last-Modified "Wed, 08 Jan 2020 23:11:55 GMT"


If I open the xsl myself and manually reload it, the xml presentation is updated as well, but this is tedious for development.

Note: There is no php or any kind of scripting involved. Everything is static.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

2 Comments

Sorted by latest first Latest Oldest Best

 

@Lengel546

According to www.askapache.com/htaccess/using-http-headers-with-htaccess.html#100_Prevent_Files_cached, this should do the trick:

Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"

10% popularity Vote Up Vote Down


 

@Angie530

You can just append a random querystring file.css?version=may15-2012 and have that data change. The browser will treat the querystring as a new file and download the CSS / JS / Image file again.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme