Forums / Install & configuration / gzip compression of output

gzip compression of output

Author Message

Geraint Edwards

Friday 13 May 2005 5:22:31 am

I'm currently experimenting with an interesting approach to gzip encoding of ezPublish output. See http://www.ilovejackdaniels.com/php/php-gzip-and-htaccess/

It seems to work (although I've not tested it through a badly configured proxy!) and reduces the size of the PHP output by 75%. Next step is to figure out a way of using mod_rewrite to serve compressed static content (my hosting service doesn't support mod_gzip or mod_deflate).

Anyone else tried this/any comments?

Geraint

Geraint Edwards

Friday 13 May 2005 5:38:38 am

OK - now the static part.

Add a gzipped copy of the CSS files e.g. site.css.gz whilst keeping the original site.css file.

Next modify your .htaccess file to add the following lines:

AddType text/css css gz
AddEncoding gzip gz

RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond  %{REQUEST_URI} ^(.*).css
RewriteCond %{SCRIPT_FILENAME}.gz -f
RewriteRule ^(.*).css $1.css.gz

Again it all seems to work and dramatically reduces the bandwidth. This time with no server overhead.

Geraint

kracker (the)

Friday 13 May 2005 8:28:38 am

Wow!

Thanks Geraint!

This thread has great potential as an eZ publish FAQ under Performance Optimizations.

cheers,
//kracker

<i>Orson Scott Card : Xenocide</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Xavier Dutoit

Friday 13 May 2005 8:34:21 am

Hi,

I remember a thread about gziping the content of the pages too. (a php only solution with ob_handler), have a look.

Also, a great trick on css is to "strip" them down (ie, erease the spaces, cr, comments...). You can find programs doing that (same for js).

Beware that some browsers (ok, maybe antics like NS4) don't cope at all with compressed css.

X+

http://www.sydesy.com

kracker (the)

Friday 13 May 2005 10:26:04 pm

Here is a list of all the other relevant eZ publish :: ( gzip / mod_gzip / mod_deflate / ob_gzhandler ) threads I've seen on ez.no

<b>References</b>
<i>http://www.ez.no/community/forum/install_configuration/administration_interface_and_mod_gzip
http://www.ez.no/community/bugs/enable_support_for_compressed_web_pages
http://www.ez.no/community/contribs/hacks/compressed_cache_files

http://www.ez.no/community/bugs/missing_doc_about_mod_deflate
http://www.ez.no/community/bugs/webdav_incompatible_with_mod_deflate

http://www.ez.no/ez_publish/info/ez_publish_2_2/forum/install_configuration/i_wish_to_make_it_lighter
http://www.ez.no/community/forum/install_configuration/gzip_compression_of_output
</i>

cheers,
//kracker

<i>eZ publish : Everything Is Possible !</i>

Fatboy Slim : Weapon Of Choice

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Jorge estévez

Friday 08 October 2010 6:34:46 am

I cannot access http://www.ilovejackdaniels.com/php/php-gzip-and-htaccess/

Can you post teh information here please...

thanks!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com