In IIS 7.5, when I don't have Output Caching enabled, my php script successfully sets browser caching in the Cache-Control header:
Cache-Control: max-age=43200,public
Content-Type: text/html
Expires: Wed, 30 May 2012 22:15:18 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/5.4.3
Date: Wed, 30 May 2012 10:15:18 GMT
Connection: close
Content-Length: 5105
However, if I enable Output Caching for .php files, I get the following header:
Cache-Control: no-cache,max-age=43200,public
Content-Type: text/html
Expires: Wed, 30 May 2012 22:25:34 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/5.4.3
Date: Wed, 30 May 2012 10:25:34 GMT
Connection: close
(notice "no-cache" is added to the Cache-Control before my php script's work)
There is no way, I've found, to prevent "no-cache" from being added to the Cache-Control key, if Output caching is enabled for a file type. I've tried to do it in the web.config file:
<customHeaders>
<remove name="X-Powered-By" />
<remove name="Cache-Control" />
<add name="Cache-Control" value="public" />
</customHeaders>
That doesn't work. Why must this be so mutually exclusive? I'd like to have both Output Caching and Browser Caching enabled.