Problem with Cache-Control header
2 posts
• Page 1 of 1
Problem with Cache-Control header
I'm having an issue with the Cache-Control max-age header being set by ExpiresByType when using certain rules in the httpd.conf file.
The following content in the httpd.confg file:
With the above configuration the Cache-Control header will be set to private, ignoring the ExpiresByType rule. If the RewriteCond and RewriteHeader rules are commented out, then the Cache-Control max-age header will be set according to the ExpiresByType rule.
The following configuration has the same issue was well:
For some reason, the RewriteCond and RewriteRule will force the Cache-Control header to private ignoring the ExpiresByType rule. If the RewriteCond and RewriteRule are commented out, then the Cache-control max-age will be set as expected.
I'm using Ape version 3.1.0.138 on IIS 7.5.
Is there a reason why these rules would override the Cache-Control directive from the ExpiresByType rule?
Please let me know if I can provide any further information.
Thank you,
Nathan Fox
The following content in the httpd.confg file:
- Code: Select all
RewriteEngine on
ExpiresActive On
ExpiresByType (text/css|image/jpeg|image/png|application/x-javascript) "now plus 1 year"
RewriteCond %{REQUEST_URI} ^/vwo(\d+)/.*
RewriteHeader X-VWO: .? %1?
With the above configuration the Cache-Control header will be set to private, ignoring the ExpiresByType rule. If the RewriteCond and RewriteHeader rules are commented out, then the Cache-Control max-age header will be set according to the ExpiresByType rule.
The following configuration has the same issue was well:
- Code: Select all
RewriteEngine on
ExpiresActive On
ExpiresByType (text/css|image/jpeg|image/png|application/x-javascript) "now plus 1 year"
RewriteCond %{QUERY_STRING} (^|&)(s=t-(.*)-%3d%3d) [NC]
RewriteRule . /Shop-For-Parts?SearchText=%3 [R=301,L,NC]
For some reason, the RewriteCond and RewriteRule will force the Cache-Control header to private ignoring the ExpiresByType rule. If the RewriteCond and RewriteRule are commented out, then the Cache-control max-age will be set as expected.
I'm using Ape version 3.1.0.138 on IIS 7.5.
Is there a reason why these rules would override the Cache-Control directive from the ExpiresByType rule?
Please let me know if I can provide any further information.
Thank you,
Nathan Fox
Re: Problem with Cache-Control header
I forgot to mention. The ExpiresByType is targeting requests for CSS, JS, JPG, and PNG files. The conditions on the rules should not match any requests for such files.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 30 guests