Problem with Cache-Control header

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 2
Joined: 07 Sep 2014, 19:03

Problem with Cache-Control header

07 Sep 2014, 19:15

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:
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

User avatar
Posts: 2
Joined: 07 Sep 2014, 19:03

Re: Problem with Cache-Control header

07 Sep 2014, 20:07

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.

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 30 guests