It's common that Web.config file for an Asp.Net (MVC or not) web application has two directives for caching under system.webServer section:
<staticContent>
<clientCache cacheControlMaxAge="07.00:00:00" cacheControlMode="UseMaxAge" />
</staticContent>
This one sets the cache control for all static contents to Max-Age: (Now+7Days)
There is also this directive under the same section:
<caching>
<profiles>
<add extension=".jpg" location="Any" policy="CacheForTimePeriod" duration="7.00:00:00" kernelCachePolicy="CacheUntilChange" />
</profiles>
</caching>
This directive sets the cache headers for .jpg files to expires: 7 days and enables caching for all locations (proxy, browser etc...)
What I don't get is, which directive overrides the other? If I omit the profile for .jpg, will it take the clientCache directive's values? (Assuming it's handled by the static file handler)
Also what does "kernelCachePolicy" do actually?