Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

How to force IIS to cache response regardless of query string?

$
0
0

I want to cache .html requests even if someone plays with query string to avoid caching.
There is my current web.config:

<?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><staticContent><clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="3650.00:00:00" /></staticContent><caching><profiles><add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="23:59:59" /></profiles></caching></system.webServer></configuration>

I open the browser, clear all cache and visit these pages consecutively:

/page.html
/page.html
/page.html?t=1
/page.html?query=test
/page.html?query=test


Only 2nd and 5th responses is being cached (304 returns). 3rd and 4th responses are not being cached (200 returns).

How to force IIS to cache responses in spite of different query string?


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>