Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

For the past few months, I’ve been having a problem with pages not loading properly in Chrome and Firefox. Here are some of the symptoms:

  • Blank pages being displayed, despite the fact that the title of the web page is showing up in the tab.
  • Sometimes, pressing refresh on a page doesn’t seem to do anything. i.e. The page won’t even reload – almost as if the request is being cancelled.
  • Pages getting “stuck” half-way.
  • A continuous “loading” icon in the browser tab that doesn’t seem to go away.
  • JavaScript and CSS files being truncated, leading to display issues and annoying client-side errors (I spent 5 minutes trying to submit a simple web form, all because the Ajax code that handled the form was being truncated).

It is worth noting that Firefox has been exhibiting the same behavior. However, instead of displaying console errors, it has been silently truncating content (I discovered this after manually inspecting Ajax requests with the Firebug extension).

While attempting to debug the issue, I came across the following error in the console of Chrome’s developer tools section:

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

What the hell?

Others have said that they were able to fix this issue by taking the following steps:

  1. Open up the settings page in Chrome.
  2. Scroll down until you see a link called “Show advanced settings…”
  3. Click on this and then find the section called “Privacy”.
  4. In this section, you will find an option called “Predict network actions to improve page load performance”.
  5. UNCHECK the checkbox and restart Chrome.

Make sure that you restart your browser before you check to see if this has worked. NB: This setting seems to revert to the default setting as soon as you clear your cache.

Unfortunately, the above “fix” did not work for me.

To get things working normally on my Apache / PHP server, I had to add the following to my .htaccess file:

SetEnv downgrade-1.0

Obviously, this is not a recommended fix, as it forces Apache to respond with HTTP/1.0 instead of HTTP/1.1 (HTTP/1.1 has a lot of advantages over 1.0). However, it was a useful temporary fix for my development machine.

The Fix (for me).

For me, the issue was being cause by the Real-time Protection feature on my ESET antivirus. Because the issue was only happening to me and nobody else, I figured that it had to be a client issue. In my attempt to solve this, I disabled my extensions, cleared Chrome’s cache and browsed the affected server in Incognito mode. I even changed my network card. Still, I kept getting the “ERR_INCOMPLETE_CHUNKED_ENCODING” error.

Finally, just as I was about to give up, I decided to disable the Real-time protection on my antivirus.

And it worked….