Google has recently published an Apache module which should optimize web sites delivery daynamically.
I was quite suspicious about such tool and though that this could only work at the costs of page outlook quality, meaning web pages not being displayed quite the same as the original. After experimenting with it I was quite please with it.

Google Reference and download pages:
https://developers.google.com/speed/pagespeed/?hl=en
http://code.google.com/p/modpagespeed/

Latest version (for developers):
http://modpagespeed.googlecode.com/svn/branches/latest-beta/src

After experimenting with it through a proxy server I configured in Apache here are the results I found so far with the current version of mod_pagespeed(ver.1.0.22.7): Before we get into the details of compilation and installation, here are my findings after moderately experimenting with an Apache proxy + mod_pagespeed:

Results:
After comparing size and number of HTTP requests, without and then with pagespeed, I can confidently conclude the following so far:

The Apache module mod_pagespeed does improve the speed and traffic load as follows:
– Average type pages are reduced around 54% of the original pages size.
– Average type pages create around 35% of the original number of HTTP requests.

Extra Notes:
– There doesn’t seem to be any advantage for text/html only pages(Pages without Images, CSS or JavaScript) other than the standard compression from deflate(gzip).
– Google pages are also not getting any better performance. Most probably because Google is already using the module they developed themselves and/or the module detects the Google pages and leaves then as-is.
– The following 2 so-far-experimental directives which are dealing with javascript and probably with CSS did modify the display of the pages slightly. Therefore I disabled them in the configuration described below.
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters detect_reflow_with_defer_js

mod_pagespeed Installation

mod_pagespeed Apache Module comes as source or as ready-to-install binaries.

Compiling and installing from source:

Here are the steps I used to compile and install the module in a Debian Squeeze environment where I had also compiled Apache 2.2.21.

For a more complete overview on how to install the module from source see the following link:
https://developers.google.com/speed/docs/mod_pagespeed/build_from_source

Prerequisites
Require Apache (>= 2.2), Python (>= 2.6), g++ (>= 4.1), svn, git, gperf, and make.
apt-get install apache2 g++ python subversion gperf make devscripts fakeroot git
# Install the Chromium Depot Tools
mkdir -p ~/bin
cd ~/bin
svn co http://src.chromium.org/svn/trunk/tools/depot_tools

Put the depot_tools in your bash PATH
cd
echo 'export PATH=$PATH:~/bin/depot_tools' >> .bashrc
. .bashrc

Check out mod_pagespeed and dependencies
mkdir ~/mod_pagespeed
cd ~/mod_pagespeed
gclient config http://modpagespeed.googlecode.com/svn/branches/latest-beta/src
gclient sync --force --jobs=1

Run Tests
cd ~/mod_pagespeed/src
make BUILDTYPE=Release mod_pagespeed_test pagespeed_automatic_test
./out/Release/mod_pagespeed_test
./out/Release/pagespeed_automatic_test

Compile the module
~/mod_pagespeed/src
make BUILDTYPE=Release
cd install

Install it within your compiled Apache environment
chmod 755 ./install_apxs.sh
APXS_BIN=/www/src/apache-2.2.21/bin/apxs ./install_apxs.sh

Apache configuration
In Apache I created a global configuration file and a vhost configuration to be included in vVirtualHosts using the Include command. This allow to selectively turn the module ON for VirtualHosts that need it.

Add in file: httpd.conf
Include conf/always_allowed.conf
Include conf/pagespeed_global.conf

Content of conf/always_allowed.conf
# Itself
SetEnvIf Remote_Host 79.xxx.xxx.xxx IP_ALLOWED
# Other fixed IPs that are allowed to us the proxy without authentication
SetEnvIf Remote_Host 52.xxx.xxx.xxx IP_ALLOWED

Content of file conf/pagespeed_global.conf
<IfModule !mod_version.c>
LoadModule version_module /www/apache/modules/mod_version.so
</IfModule>
<IfVersion < 2.4>
<IfModule !pagespeed_module>
LoadModule pagespeed_module /www/apache/modules/mod_pagespeed.so
</IfModule>
</IfVersion>
<IfModule !mod_deflate.c>
LoadModule deflate_module /www/apache/modules/mod_deflate.so
</IfModule>
<IfModule pagespeed_module>
ModPagespeed off
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"
ModPagespeedRewriteLevel CoreFilters
ModPagespeedAvoidRenamingIntrospectiveJavascript on
ModPagespeedEnableFilters add_instrumentation
ModPagespeedMessageBufferSize 100000
<Location /mod_pagespeed_beacon>
SetHandler mod_pagespeed_beacon
Order deny,allow
Deny from all
Allow From env=IP_ALLOWED
</Location>
<Location /mod_pagespeed_statistics>
SetHandler mod_pagespeed_statistics
Order deny,allow
Deny from all
Allow From env=IP_ALLOWED
</Location>
<Location /mod_pagespeed_message>
SetHandler mod_pagespeed_message
Order deny,allow
Deny from all
Allow From env=IP_ALLOWED
</Location>
<Location /mod_pagespeed_referer_statistics>
SetHandler mod_pagespeed_referer_statistics
Order deny,allow
Deny from all
Allow From env=IP_ALLOWED
</Location>
</IfModule>

In each vhost which should use mod_pagespeed
Include conf/pagespeed_vhost.conf

Content of conf/pagespeed_vhost.conf
<IfModule pagespeed_module>
# Turn on mod_pagespeed. To completely disable mod_pagespeed, you
# can set this to "off".
ModPagespeed on
#
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"
# Added some directives suggested from
# http://00f.net/2012/06/02/mod-pagespeed-as-a-proxy-for-your-phone/
ModPagespeedDomain *
ModPagespeedRewriteLevel CoreFilters
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters combine_heads
ModPagespeedEnableFilters combine_javascript
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedEnableFilters convert_png_to_jpeg
ModPagespeedEnableFilters inline_preview_images
ModPagespeedEnableFilters make_google_analytics_async
ModPagespeedEnableFilters move_css_above_scripts
ModPagespeedEnableFilters move_css_to_head
ModPagespeedEnableFilters prioritize_visible_content
ModPagespeedEnableFilters resize_mobile_images
ModPagespeedEnableFilters sprite_images
# These filter has a tendency to modify the CSS/JS
# ModPagespeedEnableFilters defer_javascript
# ModPagespeedEnableFilters detect_reflow_with_defer_js
#
ModPagespeedEnableFilters lazyload_images
ModPagespeedJpegRecompressionQuality 75
ModPagespeedFetcherTimeoutMs 3000
ModPagespeedFetchWithGzip on
SetOutputFilter DEFLATE
</IfModule>

Example of Apache proxy + mod_pagespeed

Listen 81
# Reroutes the requests from my network on Port 81 to the world (acts as proxy)
# Handles HTTP and HTTPS (if mod_proxy_connect is loaded
# Uses mod_pagespeed module to cache and rework the web sites
<VirtualHost *:81>
Include conf/pagespeed_vhosts.conf
ProxyRequests On
<Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow From env=IP_ALLOWED
</Proxy>
ProxyPreserveHost On
ProxyStatus On
ProxyBadHeader Ignore
ProxyVia On
CustomLog logs/proxy-01_access.log combined
ErrorLog logs/proxy-01_error.log
</VirtualHost>

Install binaries mod_pagespeed on Debian Squeeze

Download the mod_pagespeed from this Google page:
https://developers.google.com/speed/docs/mod_pagespeed/download?hl=en
Example:
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
Install it
dpkg -i mod-pagespeed-*.deb
apt-get -f install

Apache configuration
Use the same configuration shown above.

In case you want to test the features before you install it you sign-up to this Beta Service from Google at:
https://developers.google.com/speed/pagespeed/service?hl=en