Try our conversational search powered by Generative AI!


We are having some serious issues with EPiServer.Web.StaticFileHandler, both in our development environment and in production. We get truncated files, old versions even though the physical file is changed and warnings about headers from our firewalls. Anyone else?
Mar 06, 2009 11:19

I have seen some strange behaviour that could be related to StaticFileHandler in R2, too. Several developers working with CSS changes report that when they refresh in the browser all layout disappear.

Network analysis shows that the webserver just drops the connection when you request the css-file but other files and dynamic pages continues to work without any problem. I have not found a cause or a reproducible scenario and an iisreset solves the issue.

What is the content of your staticFileHanlder tag in your web.config? Have you changed it from default configuration that caches static files for 12 hours?

Edited, Mar 06, 2009 13:39

1) Are you running IIS 7 ?

2) Could you try to change the staticFile to someting like this so that you force cacheControl to private. You must change all instances of staticFile where you have a non-negative value on expirationTime. Does this solve your problem ?

<staticFile  expirationTime="1.0:0:0" cacheControl="private" />

Mar 06, 2009 16:25


Im also experiencing the same problems with EPiServerStaticFileHandler with R2. Im developing on an R2 release on Windows XP.

We're getting truncated .css files and until further notice i've uncommented the staticfilehandler for .css, .js files to circumvent this problem. Its unconfirmed if it solves the issue and its only a solution to be able to develop.


Mar 10, 2009 11:32

I've posted an article on this and also contacted MS to get help on the truncated files issue. I'll get back when I know more.


Mar 13, 2009 11:59

I've changed all instances to System.Web.StaticFileHandler which has removed all of our  problems. However, static files now aren't cached at all (Firebug reports 200 OK for all files, no 304s).

I'll try your solution and reintroduce the episerver static file handler cacheControl private.

Mar 16, 2009 13:22

If you haven't read Per's blog entry, this has been fixed in R2 SP2.


Oct 21, 2009 21:03
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.