interesting problem with zlib/ob_gzhandler compression

From: Date: Thu, 22 Jul 2004 13:01:09 +0000
Subject: interesting problem with zlib/ob_gzhandler compression
Groups: php.general 
Request: Send a blank email to php-general+get-191547@lists.php.net to get a copy of this message
I have ran into a rather interesting problem while zlib or gzip compression is enabled on my site. I have an external javascript-php file (a javascript file that is dynamically generated as in filename.js.php) which is included in the main template using the <script> element (for example <script src="filename.js.php"></script>). This file defines variables that are used to populate a javascript drop-down menu. With compression turned on, from time-to-time, I get a javascript error basically saying that certain variables have not been defined. At other times it works perfectly; this phenomenom appears to be completely random. My theory is, with compression turned on (via php.ini), the external php file does not get placed into the output buffer until some point in time after the currently executing script has been compressed. The reason being, is that the file is not included into the script using a php "require" construct, but rather via HTML's <script> element. I have played with this forever, and I have not found a solution. Has anyone else ran into this problem; any suggetions or comments are greatly welcomed. Thanks in advance, Christian

« previous php.general (#191547) next »