Javascript File Not Cached
4 posts
• Page 1 of 1
- voidinutah
- Posts: 20
- Joined: 25 Sep 2014, 13:59
Javascript File Not Cached
Hello,
I'm using Helicon Ape 3.1.0.248 on Windows 2012 R2 server with IIS 8. I have configured a site to use the non IIS compression, and instead use the smart_gzip_compression.conf code within just the one site. We copied the code into the individual site.
As we review the caching, using a couple of test sites, we noticed that none of the javascript files are being cached. Images and CSS have been cached with the 1 day value that is set. But all the js files are indicating no expiration specified.
Is there another setting we need to make to get the JS files cached?
Thank you,
Marc
I'm using Helicon Ape 3.1.0.248 on Windows 2012 R2 server with IIS 8. I have configured a site to use the non IIS compression, and instead use the smart_gzip_compression.conf code within just the one site. We copied the code into the individual site.
As we review the caching, using a couple of test sites, we noticed that none of the javascript files are being cached. Images and CSS have been cached with the 1 day value that is set. But all the js files are indicating no expiration specified.
Is there another setting we need to make to get the JS files cached?
Thank you,
Marc
- voidinutah
- Posts: 20
- Joined: 25 Sep 2014, 13:59
Re: Javascript File Not Cached
Basically, I copied the smart_gzip_compression.conf code to my individual site's htaccess through Helicon Ape. Here is the code I'm using
- Code: Select all
SetEnv gzip
# By file extension
SetEnvIfNoCase request_uri \.mdb$ gzip=9
SetEnvIfNoCase request_uri \.bmp$ gzip cache-enable=mem
SetEnvIfNoCase request_uri \.(?:jpg|gif|png|swf|avi|rm)$ no-gzip
# By MIME type
SetEnvIfNoCase mime text/.* gzip=9 cache-enable=mem
SetEnvIfNoCase mime audio/wav gzip cache-enable=mem
SetEnvIfNoCase mime image/bmp gzip cache-enable=mem
SetEnvIfNoCase mime message/rfc822 gzip
SetEnvIfNoCase mime application/msword gzip
SetEnvIfNoCase mime application/postscript gzip
SetEnvIfNoCase mime application/vnd.ms-excel gzip
SetEnvIfNoCase mime application/vnd.ms-powerpoint gzip
SetEnvIfNoCase mime application/vnd.ms-works gzip
SetEnvIfNoCase mime application/x-javascript gzip cache-enable=mem
SetEnvIfNoCase mime application/x-msaccess gzip
SetEnvIfNoCase mime application/pdf gzip
# Exceptions for old browsers
#BrowserMatchNoCase \bOpera(?:\s5\.|/5) and mime application/.* no-gzip vary-agent !cache-enable
#BrowserMatchNoCase \bMozilla/4\.[67] and (mime application/.* or mime image/.*) no-gzip vary-agent !cache-enable
#BrowserMatchNoCase \bNetscape(?:6/6\.|/) and mime application/.* no-gzip vary-agent !cache-enable
#BrowserMatchNoCase \bFirefox/1 and mime application/pdf no-gzip vary-agent !cache-enable
SetEnvIfNoCase (mime text/css) or (mime image/jpeg) vary-agent
BrowserMatchNoCase \bMSIE\s[567]\. and (mime text/css or mime image/jpeg) no-gzip vary-agent !cache-enable
# Vary header should be properly set for caching
Header merge Vary User-Agent env=vary-agent
# Set expiry delta for static content.
# Dynamic pages should set expiry delta by oneself.
Header merge Cache-Control max-age=86400 env=cache-enable
Re: Javascript File Not Cached
So you mean the last line with " Cache-Control max-age=86400"? Please also provide URL of your site so I can check it's exact response.
The directive in your config uses merge, so if JS responses already come with max-age setting or if there are more cache control options already attached to these responses, cache may not be active.
The directive in your config uses merge, so if JS responses already come with max-age setting or if there are more cache control options already attached to these responses, cache may not be active.
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests