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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 00:06:55
Script start
Timing: Jan 18 2025 00:06:55
Module start 'layout'
Timing: Jan 18 2025 00:06:55
Module start 'content'
Timing: Jan 18 2025 00:06:55
Module end 'content'
Timing: Jan 18 2025 00:06:55
Script end

Main resources:

Total runtime0.6945 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.3047152.6406
Module start 'layout' 0.00540.0028 741.945339.4609
Module start 'content' 0.00820.6848 781.4063655.5547
Module end 'content' 0.69300.0014 1,436.960916.1641
Script end 0.6944  1,453.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4171160.0002
Check MTime0.00130.1802160.0001
Mysql Total
Database connection0.00080.115910.0008
Mysqli_queries0.630890.8358710.0089
Looping result0.00070.0961690.0000
Template Total0.662695.420.3313
Template load0.00190.274420.0010
Template processing0.660795.139520.3304
Template load and register function0.00020.028110.0002
states
state_id_array0.00110.155710.0011
state_identifier_array0.00100.150520.0005
Override
Cache load0.00170.2442500.0000
Sytem overhead
Fetch class attribute can translate value0.00050.076740.0001
Fetch class attribute name0.00130.187980.0002
XML
Image XML parsing0.00160.237040.0004
class_abstraction
Instantiating content class attribute0.00000.002290.0000
General
dbfile0.00100.1398240.0000
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs