Content Encoding Error / Cannot Decode Raw Data (Fix Error NSURLErrorDomain)

Content Encoding Error” or “Cannot Decode Raw Data” It is the same error, the message being different from one internet browser to another. This error may appear when we try to access a Web page from the calaculator or from the mobile phone.
Safari users also receive an error code in continuing the message:NSURLErrorDomain – 1015. This means that the problem cannot be solved by the page visitor, but by the administrator of the website on which this error is present.

What is the cause of the error “Content Encoding Error” or “Cannot Decode Raw Data: (NSURLErrorDomain)

Web servers, whether we are talking about Apache or NGINX, I use a system of archive / compression and coding (encoding) gzip of web pages, to serve the data flow in smaller packages to users. For example, if a web page has the normal size of 512KB, with encoding gzip This can be reduced to 150kb. Automatically traffic for the host server and the end user will be lower with ENCODING GZIP, and the loading speed will be higher.
This Gzip content must contain some coordinates to be understood and decoded automatically, so that the file can be unpacked and listed to the end user. Valid on both a desktop and mobile browser. If this does not happen, and the gzip database flow cannot be opened, errors appear “Content Encoding Error” / NSURLErrorDomain.

For those using WordPress, the error most often occurs when The WP Super Cache Plugin is wrong. In settings “Advanced” of the module, there is a recommended option, which compresses the web pages to be served faster. “Compress pages so they’re served more quickly to visitors. (Recommended)”.

disabling to this option and delete all of the web pages in cache It can be a solution.

There is also the scenario in which the archiving is not done correctly at the server level, and the Gzip compression is activated directly from the PHP. In this scenario, you will need to deactivate the compression directly from the PHP configuration file. Zlib output compression.

How we disable “Zlib Output Compression” on a web server

Disabling can only be done by the server administrator or through a script that will give access to the file editing php.ini.

It will be set “off” for “zlib.output_compression” FROM php.ini.

; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;   outputs chunks that are few hundreds bytes each as a result of
;   compression. If you prefer a larger chunk size for better
;   performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
;   output_handler, or otherwise the output will be corrupted.
; http://php.net/zlib.output-compression
zlib.output_compression = off

After this change is made, restart the server web services and everything should return to normal.

You also do not use “Zlib Output Compression” la nivel de server daca aveti si un plugin care face deja acest lucru. Modulul va memora in cache o pagina web deja comprimata, iar la utilizatorul final rezultatul va fi o eroare de decodare a paginii web. 

Passionate about technology, I write with pleasure on stealthsetts.com starting with 2006. I have a rich experience in operating systems: Macos, Windows and Linux, but also in programming languages ​​and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, Presashop).

Home Your source of IT tutorials, useful tips and news. Content Encoding Error / Cannot Decode Raw Data (Fix Error NSURLErrorDomain)
Leave a Comment