Reputation: 23818
I have implemented static content caching on the Images folder in our application by creating the below Web.config file in the Images folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
I believe this has the effect of caching all the images on the client side for 365 days.
I tested the caching using fiddler by examining the response headers.
Initially, I was able to see headers for all files in the Images folder to have a max-age value of
Cache-Control: max-age=31536000
However, suddenly today I was not able to see it.
There have been no changes to the code or config.
Can someone please shed some light on why this is happening and how I can better test if caching is correctly working?
Thanks, Rashmi
Upvotes: 3
Views: 342