On an ASP.NET site, I would like to add the “Expires” header to some static files, so I added a configuration clientCachelike this for the folder where these files are located:
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Wed, 13 Feb 2013 08:00:00 GMT" />
</staticContent>
If possible, I would like to programmatically calculate the value httpExpiresto set it, for example, until the last file update + 24 hours.
Is there a way to configure the cache control to get the value httpExpiresby calling the method?
If not, what are the alternatives? I was thinking of writing a custom HTTP handler, but maybe there is a simpler solution ...
EDIT: Please note that these are static files, therefore they are not served by the regular asp.net page handler.