[TYPO3-dev] Content-Length header wrong?

Ries van Twisk typo3 at rvt.dds.nl
Wed May 17 19:08:15 CEST 2006


Neil Bertram wrote:

>Hi,
>
>I'm trying to implement Apache 2's mod_cache in front of TYPO3 on a very 
>busy web server. It hasn't been caching TYPO3 content, despite 
>config.sendCacheHeaders being set, which confused me.
>
>I discovered now that mod_cache will only cache the output if the 
>Content-Length header is set. By setting 
>config.enableContentLengthHeader TYPO3 will output this header when 
>possible. Great!
>
>Even with this header, mod_cache is refusing to cache the page. I also 
>noticed Firefox locked up for a while as it loaded the page when the 
>content-length header was enabled. This lead me to believe that the 
>value being sent was incorrect. I think I was right...
>
>For one page on the site, TYPO3 is specifying a length of 8527 bytes on 
>the content-length header. From its browser cache, Firefox claims the 
>length was 8522 bytes. I tried this for several pages and found each was 
>out by a small (but varying) amount.
>
>I realise the content-length code probably hasn't been touched since it 
>was introduced in 2004, so is it possible that something has changed 
>that makes strlen($this->content) in tslib_fe not a valid measurement? 
>My first guess would be some postproc function like xhtml_cleaning is 
>modifying the output after it gets measured, but I'm not sure.
>
>I'd like to propose that content-length is only ever sent for pages 
>retrieved from typo3's cache, that way the filesize of the cache file 
>can be used to give an absolutely exact reading of the length going out 
>on the wire.
>
>Ideas?
>  
>
Maybay the problem is right there,

the strlen function is not multibyte save... Try changing it to one of 
the multi-byte save version.

Ries


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web:   http://www.livetravelguides.com





More information about the TYPO3-dev mailing list