Cached EPiServer License Violation script error

You will probably first notice that something is wrong because you get strange behavior from EPiServer. Maybe the right-click menu does not work in view mode or something misbehaves in edit mode.

I had a client with this issue who could not get EPiServer to work again and nothing had really changed in the setup. What was wrong?

JavaScript error on page

We could rater fast establish that there was JavaScript errors on the page and with script debugging we found that the following:

License violation! License is already in use at another online site: http://test.local/ [_LM_W3SVC_2_Root]/*
* episerverscriptmanager.js - JavaScript support routines for EPiServer

An error message from EPiServer was inserted before the text breaking the code.

Strategy: Finding EPiServer SCRIPT AND CSS errors with Fiddler

image_thumb[9]_thumb[1][7]But there is nothing wrong with the license! Checking the license in EPiServer admin mode showed no issues, so what is going on here?

A favorite tool to get more clues and diagnose what’s wrong is Fiddler (see my toolbox page for links and other tools).

With Fiddler you will easily identify any broken links. 404-error (file not found) errors lights up and you can see all broken links to JavaScript files, CSS-files and images referenced by CSS.

As you also can see almost all static files has a cache directive that tells the browser to cache the file for 12-hours. Hmm… this has probably something to do with the fact that the file looks good if we download it manually but still generates JavaScript errors.

EPiServer Static File Handler

A default installation of EPiServer CMS 5 contains this line:

<staticFile expirationTime="12:0:0" />

The expiration time makes EPiServer’s Static File Handler to add a cache directive and expiration time to all static files.

Press F5 to Refresh does not always refresh


Refresh with F5 in your browser does not have the expected result! It will only ask the web server if there is a newer version available. Your web server will answer 304 – The file is not modified.

In our case this behavior is the real reason to our problem.

There was a license problem when the site was first visited and EPiServer inserts this text to make sure you notice that you have an invalid license. Unfortunately this broken version of the file got cached and removing all cached files for this domain from the Browser is the only way to resolves the issue.

Summary and conclusion

EPiServer Static File Handler adds a cache directive to static files. If a file is modified dynamically, like when EPiServer emits an error message, the broken version will be cached and refresh with F5 will not reload it – you must clear you browser cache.