Hallo iedereen,
Ik ben momenteel bezig met een uitbreiding van mijn framework waarbij ik mijn templates een gzip compressie wil geven. Alleen elke keer wanneer ik mijn pagina laad worden de headers niet meegestuurd lijkt het wel... Weet iemand hoe ik dit kan oplossen, want ik ben al ruim een uur aan het zoeken en kan momenteel niks vinden wat nuttig is?
<?php
// Gzip compression...
// Whether it returns false it will use normal compression.
if (ob_start("ob_gzhandler") === false) {
ob_start();
}
?>
Php.net
CitaatAn optional output_callback function may be specified. This function takes a string as a parameter and should return a string. The function will be called when the output buffer is flushed (sent) or cleaned (with ob_flush(), ob_clean() or similar function) or when the output buffer is flushed to the browser at the end of the request. When output_callback is called, it will receive the contents of the output buffer as its parameter and is expected to return a new output buffer as a result, which will be sent to the browser. If the output_callback is not a callable function, this function will return FALSE.
Alvast bedankt,
Michael Beers
Edit
Het is misschien handig het hele script te posten:
http://pastebin.com/yA54FEg9