apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
696 stars 159 forks source link

Help accounting for number of bytes served pre and post-optimization #333

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using mod_deflate for some time now. I require knowledge of original size 
of webpage before compression per every request. I achive this with mod_logio 
and something like that:

LogFormat "%h %l %u %t \"%r\" %>s |axxa| \"%{Referer}i\"
\"%{User-Agent}i\"|move%I|%O|%{outstream}n|%{instream}n" combined

<VirtualHost * >
...
DeflateFilterNote Input instream
DeflateFilterNote Output outstream

CustomLog /home/domlogs/file combined
...
</virtualhost>

That works fine. I can check original size before compression on every request. 
However mod_pagespeed uses some internal directives to deflate and I'm unable 
to DeflateFilterNote 

<VirtualHost * >
...
CustomLog /home/domlogs/file combined
<IfModule pagespeed_module>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
    ModPagespeed on
    ModPagespeedFileCachePath            "/home/mod_pagespeed/naox/cache/"
    ModPagespeedGeneratedFilePrefix      "/home/mod_pagespeed/naox/files/"
    ModPagespeedRewriteLevel PassThrough
    ModPagespeedEnableFilters extend_cache
    <Location /mod_pagespeed_beacon>
          SetHandler mod_pagespeed_beacon
    </Location>
</IfModule>
...
</virtualhost>

logging works fine, but %{outstream}n|%{instream} are empty. Compression 
however takes place (which I see sniffing packets and on the size in %I|%O).

Original issue reported on code.google.com by krz...@gmail.com on 8 Aug 2011 at 3:27

GoogleCodeExporter commented 9 years ago
Hi -- what is the goal of your usage of DeflateFilterNote?  Why do you need the 
original size of the web-page before compression?

What's different about your site as opposed to the generic usage of mod_deflate?

Original comment by jmara...@google.com on 8 Aug 2011 at 3:36

GoogleCodeExporter commented 9 years ago
mod_pagespeed offers more optimalizations than pure deflate (which currenty I 
dont use all, but maybe later).

I need original size of webpage, request in fact, so I continue to account 
bandwidth for customers on same level even with compression. This days 
bandwidth limitations are (over) simplified markers for resource use (like 
processing power, io, memory). Those resources are much much harder to monitor, 
and also are not simple or transparent to customers. So most hosting providers 
base differenting their services on bandwidth calulation, even if actual 
bandwidth might not be issue at all (!)

Original comment by krz...@gmail.com on 8 Aug 2011 at 3:41

GoogleCodeExporter commented 9 years ago
I know that many other filters od mod_pagespeed save bandwidth, so that is also 
bad, but compression (deflate) does most of it - so DeflateFilterNote would be 
priority.

Original comment by krz...@gmail.com on 8 Aug 2011 at 3:44

GoogleCodeExporter commented 9 years ago
summary was: not compatibile with DeflateFilterNote

This could be accomplished via logging, response-headers, or statistics.

Original comment by jmara...@google.com on 24 May 2012 at 7:41