Bug #20413

wrong content-length header breaks frontend in case of proxy-usage

Added by Georg Kühnberger almost 11 years ago. Updated almost 10 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


class.tslib_fe.php, function processOutput() calculates the content-length wrongly in case of enabled debug.

In case of config.debug = 1 or $TYPO3_CONF_VARS['FE']['debug'] = '1'; the calculated content-length will differ from the really sent content-length;
basically the calculation misses the "Cached page generated ...Expires ... text below the closing html tag.

Now in case of using a forwarding or reverse Proxy like Squid (2.7), the proxy will choke upon the difference of content-length information from the header and the really delivered content-length with an Error like this: httpReadReply: Excess data from "GET http://domain.com/123.html"

Even worse the Proxy will NOT deliver the complete page but will cut it off somewhere in the middle (observed with pages larger than 30.000 bytes).

Thus I percieve this as a severe bug, as turning on the "debug" feature should not break the frontend.

Solution: In case debug is activated, TYPO3 should not send content-length at all; proxies will behave nice then and deliver the complete page.

Patch: Simply added two more conditions to class.tslib_fe.php, function processOutput()

Note: You should not trust the Firefox Page-Size-Information (Extras > Information > Page-Size); FF seems to ignore everything behind the closing html tag, and thus report a wrong document-size.

(issue imported from #M11063)

bug_11063.diff View (1.18 KB) Administrator Admin, 2009-05-10 02:55

Related issues

Related to TYPO3 Core - Bug #15337: Wrong Content-Length header implement in TSFE Closed 2005-12-30
Related to TYPO3 Core - Bug #19715: Content-length header is calculated incorrectly Closed 2008-12-18
Related to TYPO3 Core - Feature #19717: Use PHP built–in gzip/deflate compression in Frontend Closed 2008-12-18


#1 Updated by Georg Kühnberger almost 11 years ago

uploaded corrected unified diff

#2 Updated by Georg Kühnberger almost 11 years ago

the bug is somewhat related to #19715 #19715 and #19715 - however I dont want to wait for those, but like to see this issue being fixed in the next 4.3 release

#3 Updated by Michael Stucki almost 11 years ago

Fixed in TYPO3 4.2.7 and later. Thanks Georg!

Also available in: Atom PDF