Hello Kristoffer,
Look in Web.config for the following line of code:
<staticFile expirationTime="12:0:0"/>
It sounds like you should change this setting according to your needs.
Best regards
Martin
Hi Kristoffer
See my post: Part 8: Preparing for launch – Create an EPiServer site from scratch, under the section: Expires HTTP headers, for more information on how to do this for both IIS 6 and IIS 7.
Hope this helps.
Frederik
Thank you. I have only tried it in our test environment, but it works like a charm.
Is it possible to do the same override on the VirtualPathVersioningProvider?
For VPP folders you can use the method described by Martin, updating the staticFile expirationTime setting in web.config.
<location path="PageFiles">
<system.webServer>
<handlers>
<add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
<add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
</handlers>
</system.webServer>
<staticFile expirationTime="-1.0:0:0" />
</location>
<location path="Documents">
<system.webServer>
<handlers>
<add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
<add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
</handlers>
</system.webServer>
<staticFile expirationTime="-1.0:0:0" />
</location>
<location path="Global">
<system.webServer>
<handlers>
<add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
<add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
</handlers>
</system.webServer>
<staticFile expirationTime="-1.0:0:0" />
</location>
So, changing -1.0:0:0 (one day back), to 20.0:0:0 will set the expiration date to 20 days.
I’m trying to set far-future expires headers on static files such as images, css and js-files. Using ISS Manager I have enabled content expiration and set the time to 365 days. This worked when we were using episerver 4.62, now when we are using episerver CMS 5 R2 SP2 it has no effect. The expiration headers are still only 12 hours. What to do?