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?
License violation! License is already in use at another online site: http://test.local/ [_LM_W3SVC_2_Root]/*
An error message from EPiServer was inserted before the text breaking the code.
Strategy: Finding EPiServer SCRIPT AND CSS errors with Fiddler
A favorite tool to get more clues and diagnose what’s wrong is Fiddler (see my toolbox page for links and other tools).
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.