Minify Cache-Control possible bug?
-
Something strange is happening with the Cache-Control headers for the generated minify files, forcing them to have “max-age=0, public, max-age=31536000”, and therefore they are not being cached by my CDN.
check it out:
curl -I https://www.<mydomain>.com/wp-content/cache/minify/18035.css?x11355
HTTP/1.1 200 OK
Date: Thu, 08 Mar 2018 03:15:44 GMT
Server: Apache/2.4.7 (Ubuntu)
Content-Length: 1900874
X-Powered-By: W3 Total Cache/0.9.6
Pragma: public
Vary: Accept-Encoding
Last-Modified: Wed, 07 Mar 2018 18:54:52 GMT
ETag: “pub1520448892”
Cache-Control: max-age=0, public, max-age=31536000
Access-Control-Allow-Origin: *
Expires: Fri, 08 Mar 2019 03:08:59 GMT
X-Content-Type-Options: nosniff
Content-Type: text/css; charset=utf-8What’s weird is that the .htaccess file looks to be correct:
:/var/www/<mydomain>/wp-content/cache/minify$ cat .htaccess
# BEGIN W3TC Minify cache
FileETag MTime Size
<IfModule mod_mime.c>
AddType text/css .css_gzip
AddEncoding gzip .css_gzip
AddType application/x-javascript .js_gzip
AddEncoding gzip .js_gzip
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
SetEnvIfNoCase Request_URI \.css_gzip$ no-gzip
SetEnvIfNoCase Request_URI \.js_gzip$ no-gzip
</IfModule>
</IfModule>
<IfModule mod_headers.c>
Header set X-Powered-By “W3 Total Cache/0.9.6”
Header set Vary “Accept-Encoding”
Header set Pragma “public”
Header set Cache-Control “max-age=31536000, public”
</IfModule>
# END W3TC Minify cache
# BEGIN W3TC Minify core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/cache/minify/
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* – [E=APPEND_EXT:_gzip]
RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f
RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]
RewriteRule ^(.+\.(css|js))$ /index.php [L]
</IfModule>
# END W3TC Minify coreCan anyone verify this? I should note that I’m also running mod_pagespeed, but turning that on and off doesn’t seem to change anything.
- The topic ‘Minify Cache-Control possible bug?’ is closed to new replies.