eZ Community » Forums » Install & configuration » gzip compression of output
expandshrink

gzip compression of output

gzip compression of output

Friday 13 May 2005 2:22:31 pm - 5 replies

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

Friday 13 May 2005 2:38:38 pm

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

Friday 13 May 2005 5:28:38 pm

Wow!

Thanks Geraint!

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

cheers,
//kracker

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

Modified on Saturday 14 May 2005 7:16:59 am by // kracker

Friday 13 May 2005 5:34:21 pm

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+

Saturday 14 May 2005 7:26:04 am

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/...dministration_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/...figuration/i_wish_to_make_it_lighter
http://www.ez.no/community/forum/...iguration/gzip_compression_of_output
</i>

cheers,
//kracker

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

Fatboy Slim : Weapon Of Choice

Modified on Saturday 14 May 2005 7:27:50 am by // kracker

Friday 08 October 2010 3:34:46 pm

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

Can you post teh information here please...

thanks!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu