WebResource Embedded Resource Files Caching
Yesterday, I got a mission to
check why some web forms in
my current project have poor
performance. After some research
with the Fiddler tool I found that
the WebResource.axd files are
reloaded in every page request.
These files are used for script callbacks by the Ajax extensions. The thing about
those files are that they are very big and therefore consume a lot of bandwidth
and make the page load very slow. Checking the issue further I noticed that the
files were sent with the Cache-Control: private header therefore they were never
cached. The issue happens because when an assembly is compiled in debug mode
the caching is made private which means that no caching will happen. To solve the
problem just compile the assembly in release mode which will result in a public
Cache-Control header. Because I’m currently not a member in the team that update
the production version I went to check whether the system is compiled in release mode
before it goes to production. Guess what was the answer…
Yep, no release compilation and a penalty of performance to our system.
The issue is currently been checked and hopefully the next version will be in release
For further reading in the subject I recommend Rick Strahl’s post.