That should do it but a sugestion is to remove the types of images as well in the static content section:
<!-- Image types --> <remove fileExtension=".jpg"/> <mimeMap fileExtension=".jpg" mimeType="image/jpeg"/> <remove fileExtension=".png"/> <mimeMap fileExtension=".png" mimeType="image/png"/>
Have you register this as well:
<configSections> ... <section name="staticFile" type="EPiServer.Framework.Configuration.StaticFileSection" /> </configSections> <staticFile expirationTime="365.0:0:0"/>
Thanks for your reply Eric. I tried removing the image types but still don't see any change in the response headers. I already had the section registered as well. Do you know of anything that might be overriding this?
We are using EpiServer 7.5 and I've heard the way the media system is configured has changed in this version but I can't find any information as to how to cache content served by the media system. I did find a post by someone else asking the same question without an answer but unfortunately haven't managed to find any advice on how to handle this in EpiServer 7.5.
Here's a link to the question:
The response headers I'm getting are below:
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNetMvc-Version: 4.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET X-Frame-Options: SAMEORIGIN Date: Fri, 09 Dec 2016 10:03:09 GMT Content-Length: 17418
Thanks
Hi All,
I've been trying to get client caching of images served by the media system in EpiServer working. Essentially I want to be able to set the Cache-Control:max-age header but nothing I've tried so far has made any difference to the value of this header. Currently I get a value of Cache-Control:public for all images in globalassets.
The following works for static files that are part of my project, meaning I get a Cache-Control value of max-age=604800 for those images:
But doesnt have any effect on files in globalassets.
I've also tried:
But that doesnt work whether I put it inside a <location> (as below) or globally.
Does anyone else know how this should be configured? Any help would be super appreciated!
Thanks