Js errors in FF error console

Topics: ASP.NET 2.0
Apr 23, 2009 at 6:07 PM
Just setup a new blog on latest version and it seems fine but with javascript errors in the console such as:

Error: syntax error
Source File: http://www.domain.com/blog/error404.aspx?aspxerrorpath=/blog/js.axd
Line: 3
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Error: WebForm_InitCallback is not defined
Source File: http://www.sdomain.com/blog/
Line: 300

Any ideas?
Apr 23, 2009 at 6:37 PM
On the Settings tab in the Control Panel, in the Advanced Settings section, there's a 'Compress WebResource.axd' option.  Try unchecking that and see if it makes a difference.
Apr 23, 2009 at 6:45 PM
Thanks for that. When I posted I had both http compression on and compress webresource on.

I found it was dog slow at loading pages, sometimes almost 30 seconds. I switched off http compression and recycled the app pool and it speeded up to page loads under a second. Also the js errors went.

Then I switched back on http compression and switched off compress webresource, recycled the app pool and it;s the same, v fast and no js errors.

So, the errors occur when they are both switched on, and it grinds to a halt. Its not the server because it's a dedicated box with hardly anything on it.

Any ideas what it could be?
Apr 23, 2009 at 7:02 PM
I've seen this a couple of times.  And in one case, it was the same thing where it was taking 30 seconds or so for the page to load.

I don't think it's related to HttpCompression, but just the Compressing of the WebResource.axd.  The problem is, when you have Compress WebResource.axd on, instead of a <script> tag directly to WebResource.axd going to the browser, you instead get a <script> tag for BE's JavaScript handler (js.axd) with a querystring parameter for WebResource.axd.  The script tag looks similar to this:

<script src="/js.axd?path=http%3a%2f%2fwww.example.com%2fWebResource.axd%3fd%3dj246orv_38DeKtGbza6y6A2%26amp%3bt%3d633595084183430636" type="text/javascript"></script>

When the JS.axd handler gets this request, it sees the "path" querystring parameter which is an absolute URL.  It's a little hard to read above because of the URL encoding, but the absolute URL decoded is:


The JS.axd handler makes a webrequest to download this resource.  When you're seeing this 30 second delay, it's happening while JS.axd is waiting for this resource to get downloaded.  I'm pretty certain the problem has to do with the web server/firewall/router environment.  On some server setups, if you make a request to a domain name/URL which resolves to the same server you're making the call from, the request is blocked, gets confused, or something along those lines -- and it eventually times out.

If you have a dedicated server, and while logged into the server, if you pull up a browser and try navigating to your site (even just the homepage) using the external domain name or IP address, I'm pretty sure you'll get this delay and it will end up timing out.  I'm not very familiar with these types of network issues, so I don't know the solution offhand.  This is just what I tracked down the problem to be.
Apr 23, 2009 at 7:06 PM
Ok thanks. I'm fine with leaving the "compress webResource" unchecked. It seems fine now.

That will be fine wont it?
Apr 23, 2009 at 7:07 PM
Definitely, there will be no problems.  It's just an optional optimization.
Apr 23, 2009 at 7:08 PM