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

eZ debug

Timing: Jan 17 2025 20:53:23
Script start
Timing: Jan 17 2025 20:53:23
Module start 'content'
Timing: Jan 17 2025 20:53:24
Module end 'content'
Timing: Jan 17 2025 20:53:24
Script end

Main resources:

Total runtime1.2170 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 597.2656180.8281
Module start 'content' 0.00611.0922 778.0938696.2969
Module end 'content' 1.09830.1186 1,474.3906337.3203
Script end 1.2169  1,811.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2915210.0002
Check MTime0.00130.1098210.0001
Mysql Total
Database connection0.00060.049110.0006
Mysqli_queries1.127292.62332080.0054
Looping result0.00180.14762060.0000
Template Total1.188097.620.5940
Template load0.00170.139420.0008
Template processing1.186297.473520.5931
Template load and register function0.00010.010510.0001
states
state_id_array0.00110.092710.0011
state_identifier_array0.00090.077120.0005
Override
Cache load0.00150.1225500.0000
Sytem overhead
Fetch class attribute can translate value0.00130.103750.0003
Fetch class attribute name0.00100.085880.0001
XML
Image XML parsing0.00720.594650.0014
class_abstraction
Instantiating content class attribute0.00000.001490.0000
General
dbfile0.01140.9385350.0003
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs