flushing output buffer with mod_deflate

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-23-2004
Alvaro G Vicario
 
Posts: n/a
Default flushing output buffer with mod_deflate

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
--
  #2 (permalink)  
Old 12-24-2004
HansH
 
Posts: n/a
Default Re: flushing output buffer with mod_deflate

"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



  #3 (permalink)  
Old 01-07-2005
Alvaro G Vicario
 
Posts: n/a
Default Re: flushing output buffer with mod_deflate

*** 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
--
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:04 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0