"This is an invalid webresource request" error message


Description

The following error may appear in Sitecore log files when users request various ASP.NET resources via URLs like WebResource.axd and ScriptResource.axd. Such resources may, for example, include ASP.NET AJAX scripts.

Message: This is an invalid webresource request.
System.Web.HttpException
Source: System.Web
  at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
  at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Solution

In most situations, the cause of this error is not directly related to Sitecore, but rather to the general site configuration.

Several common causes for this behavior are listed below:

Cause 1:
This error may occur when running a load balanced environment without using a "sticky" session policy.
If different servers have different machine keys, the request to a resource may fail due to the encrypted querystring parameter identifying the resource being non-decryptable on another server.
Solution 1: 
Make sure that all servers use the same <machineKey> (both validationKey and decryptionKey). The following article describes how to configure machine keys:
http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations
Cause 2:
Problem with processing a specific Web Resource.
Solution 2:
If you know the URL of the problematic resource, it is possible to decrypt the query string of the request that causes the problem using this page. This allows you to determine the name and location of the resource that causes the error.
More information on this:
http://blogs.telerik.com/hristodeshev/posts/07-03-27/debugging-asp-net-2-0-web-resources-decrypting-the-url-and-getting-the-resource-name.aspx
If the resource that causes the error is located in an assembly provided by Sitecore, please contact Sitecore Support.
Cause 3:

This error may also occur when a client browser or a search engine attempts to re-validate its cached contents for the WebResource.axd or ScriptResource.axd requests, possibly using query string parameters that are no longer valid.

Solution 3:

The error will stop occurring once the data is properly reloaded.