On an Umbraco 13 site I help develop, we’re trying to set the Cache Control header for our ImageSharp images to one year. Our appsettings file is correctly configured, as specified here:
Here’s the relevant node in our appsettings file:
"Umbraco": {
"CMS": {
"Imaging": {
"Cache": {
"BrowserMaxAge": "365.00:00:00",
"CacheMaxAge": "365.00:00:00"
},
"Resize": {
"MaxWidth": 5000,
"MaxHeight": 5000
},
"HMACSecretKey": ""
}
}
}
What we’re finding is that, much of the time, the Cache Control header is what you’d expect/hope for (1 year). Sometimes, however, the Cache Control header is the default time of 7 days. That said, if I change the query string of the image in any way, for example, changing the order of the parameters, that seems to wake it up and the Cache Control header is correctly set to a year. I thought at first this might be some soft of caching issue, and I suppose it might be(?), but I did all my testing for this in incognito mode.
Any idea what could be causing this or if there’s a fix for this? Thanks.