This is a discussion on Force browser to cache files within the Apache Web Server forums, part of the Web Server and Related Forums category; I want to send the browser some headers to force it to cache .js and ..css files. Is there any ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hermann wrote: > I want to send the browser some headers to force it to cache .js and > .css files. > > Is there any way to configure apache to do this?? > > Thanks. ExpiresActive on ExpiresByType application/x-javascript A86400 #possibly the mime-type should be the above, but if not then try #ExpiresByType text/javascript A86400 ExpiresByType text/css A86400 or just ExpiresDefault A604800 if you want imeage html etc.. all expired. A[seconds] after Access, just check the Temp Internet Dir for internet explorer to see if your caching is working as you expect if you have no access to a proxy to check the headers see the manual for more. |
|
|||
|
by default IE 6 caches css and js files...no need to do anything!
shimmyshack wrote: > Hermann wrote: > > I want to send the browser some headers to force it to cache .js and > > .css files. > > > > Is there any way to configure apache to do this?? > > > > Thanks. > > ExpiresActive on > ExpiresByType application/x-javascript A86400 > #possibly the mime-type should be the above, but if not then try > #ExpiresByType text/javascript A86400 > ExpiresByType text/css A86400 > > or just ExpiresDefault A604800 if you want imeage html etc.. all > expired. > > A[seconds] after Access, > > just check the Temp Internet Dir for internet explorer to see if your > caching is working as you expect if you have no access to a proxy to > check the headers > > see the manual for more. |
|
|||
|
kisero wrote: > by default IE 6 caches css and js files...no need to do anything! > imho this is only the case when tools->internet options->general->settings->never is set, which is not the default, but even then it is best to force every compliant browser to behave in a predictable way rather than relying on a behaviour of a browser which can be changed or updated without your consent. Also IE has a caching bug which means that images (that you might use for rollovers) wont be cached, and there can sometimes be an irritating delay while a request is sent before the rollover changes, other flashing background and so on can be fixed by sending IE6 the right headers. |
|
|||
|
well, i did this test yesterday with the default configurations. (on
IE) and of course the web server was not sending any cache headers back to the client to make sure nothing was forced. me! shimmyshack wrote: > kisero wrote: > > by default IE 6 caches css and js files...no need to do anything! > > > > imho this is only the case when > tools->internet options->general->settings->never > is set, which is not the default, but even then it is best to force > every compliant browser to behave in a predictable way rather than > relying on a behaviour of a browser which can be changed or updated > without your consent. > > Also IE has a caching bug which means that images (that you might use > for rollovers) wont be cached, and there can sometimes be an irritating > delay while a request is sent before the rollover changes, other > flashing background and so on can be fixed by sending IE6 the right > headers. |
| Thread Tools | |
| Display Modes | |
|
|