This is a discussion on flushing output buffer with mod_deflate within the Apache Web Server forums, part of the Web Server and Related Forums category; I've configured my Apache 2 server (Red Hat 9) to compress text files using mod_deflate. This works fine and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've configured my Apache 2 server (Red Hat 9) to compress text files using
mod_deflate. This works fine and really speeds up things. However, I have a PHP script that takes a long time to run and needs to send some status info to browser so the user knows it's running, something like: * Processing record 1 of 50... * Processing record 2 of 50... * Processing record 3 of 50... mod_deflate holds all this output until the script ends and once it's all done it compresses the output and sends it to browser. I've read the module documentation but couldn't find a way to disable compressing per directory or per script. I cannot change the MIME type of the output because I need it to be displayed within browser window. If you could think of an elegant solution I would really appreciate it. Well, even if it's not elegant at all :) -- -- Álvaro G. Vicario - Burgos, Spain -- Thank you for not e-mailing me your questions -- |
|
|||
|
"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> schreef in
bericht news:1huppp5hcqlxr$.1brolk9rttrn8$.dlg@40tude.net. .. > mod_deflate holds all this output until the script ends and once it's all > done it compresses the output and sends it to browser. > > I've read the module documentation but couldn't find a way to disable > compressing per directory or per script. You can steer mod_deflate by enviroment variables http://httpd.apache.org/docs-2.0/env.html#special and set those by a variety if means http://httpd.apache.org/docs-2.0/env.html#setting The larger example at http://httpd.apache.org/docs-2.0/mod...ml#recommended shows a line disabling compression for the most common image files SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary Prefixing the file name by 'nph-' might work aswell, though, most likely, its output will lack some HHTP headers. Eitherway, thereafter you might want to try to get your php script to do some deflating on each chunk too ... http://www.php.net/manual/nl/ref.zli...ut-compression HansH |
|
|||
|
*** HansH wrote/escribió (Fri, 24 Dec 2004 00:59:07 +0100):
> You can steer mod_deflate by enviroment variables > http://httpd.apache.org/docs-2.0/env.html#special > and set those by a variety if means > http://httpd.apache.org/docs-2.0/env.html#setting It works like a charm. I wasn't able to set env vars from PHP but a simple ..htaccess file solved the issue: <Files my-long-running-script.php> SetEnv no-gzip 1 </Files> Thank you very much and sorry for the delay (X-mas and other stuff, you know :) -- -- Álvaro G. Vicario - Burgos, Spain -- Thank you for not e-mailing me your questions -- |