3

With Chrome, I get always the error net::ERR_CONTENT_LENGTH_MISMATCH and the page is blank. Other browsers like Firefox doesn't has that problem. I googled a lot but with no really luck.

It's a typo3 page which I recently moved. On the old server it worked without any problem.

I know the error means that the Content-Length which is submitted in the header does not match with the length which of the document / file, but I have no idea why and what I can do.

Does anyone has some advice?

andreas
  • 16,357
  • 12
  • 72
  • 76
mastercheef85
  • 2,109
  • 3
  • 18
  • 25
  • The server is sending 'Content-Length: 36532` but the file is only `36429` bytes. Either it's a bug in the server, or your script is using `header('Content-length: something');` and that needs to be fixed. – Barmar Sep 09 '16 at 20:10
  • try to found the log from server side, maybe a permission issue. https://stackoverflow.com/questions/25993826/err-content-length-mismatch-on-nginx-and-proxy-on-chrome-when-loading-large-file/76827595#76827595 – Dolphin Aug 03 '23 at 11:21

2 Answers2

3

Add this to the Typoscript Setup

config.enableContentLengthHeader = 0
bschauer
  • 958
  • 9
  • 33
  • Very quick solution, will solve the issue! For those requiring a content-length header for whichever reason, see response below about causes for this problem and how to correct it (rather than work around it). – Claus Due Sep 10 '16 at 14:57
2

This is just for completeness:

Look for any extension which is using the "feof" (frontend end-of-file) hook in page generation. If the content, which is already completely rendered at this point, changes size, the error above can occur. If the code that changes the content size is your own then you can also avoid this by sending a correct Content-Length header after you have modified the content. If the code is not your own then your only options are to deactivate the extension doing this - or set the config.enableContentLengthHeader = 0 parameter like @bschauer says in the already accepted answer.

Claus Due
  • 4,166
  • 11
  • 23