Wednesday, August 22, 2018

ERR_SPDY_PROTOCOL_ERROR

I have recently moved the nameservers of my domains from fastmail (where the email is still hosted) to Cloudflare in order to benefit from their caching and performance improvements. All seemed well, except for the fact that my main homepage (https://mauroy.eu) was not accessible from Chrome anymore. Firefox didn't have any issue though.

The developer tools (F12) gave me the error: ERR_SPDY_PROTOCOL_ERROR. I googled a bit and found many articles, but none gave me the solution. One did give a part of the clue: a post on the Cloudflare forum talked about a discrepancy between the length of the content and the value of the content-length header. What could cause that? I thought about a compression issue and checked the settings of my IIS server. Both the static and dynamic content compression settings were enabled, something I do by default when I create a site on IIS. Apparently, when HTTP2/SPDY is enabled, Chrome does an additional check on the content length. A possible solution was to disable SPDY on Cloudflare, something that can only be done through the API. I preferred to disable compression at the source, and presto, the site was available again on Chrome...

To disable compression you can do it through the web.config file of the site:
<urlCompression doStaticCompression="false" doDynamicCompression="false" />
inside the webServer node or use the GUI that will update the file for you:



And click "Apply" in the "Actions" pane on the right side.

Simple solution to this problem, I just needed to find out about it ;-)

Hope this helps anyone.