Forum

Enable compresion, Optimize images..

Amar
8 May 2012, 22:11
Hello Hugo

First off, that email I sent you other day.. it was Joomla issue, fixed : )

Now this Joomla site is one that gets 150000 uniques per month. Thing is site is 3.5 - 4.5 MB per load heavy. Now this Google thingy is telling me to do two above mentioned things https://developers.google.com/speed/pagespeed/insights#url=http_3A_2F_2Fzenicablog.com_2F&mobile=false

When you think about it, enabling compresion and optimizing images could save a lot. Now I have UseGZfile = yes but now I am not sure if it works at all.

I also have these 'expires' toolkit that I am not sure it works too:

UrlToolkit {
ToolkitID = expires
Match .*\.jpg$ Expire 1 weeks
Match .*\.png$ Expire 1 weeks
Match .*\.gif$ Expire 1 weeks
Match .*\.css$ Expire 1 weeks
Match .*\.js*$ Expire 1 weeks
}


Do you have any idea/tip what could I do to fix this.. other than puting nxing in front : )

Thank you

Hiawatha version:
Operating System:
Hugo Leisink
8 May 2012, 22:43
Enabling compression is easy. Use the following PHP settings:
zlib.output_compression = On
zlib.output_compression_level = 6


When you think about it, enabling compression and optimizing images could save a lot.

Ever compressed an image? Try it and see how bad images can be compressed. That's why I don't like on-the-fly compression. In many cases it's just a waste of CPU power.

Textfiles like stylesheets and javascripts however can be compressed very well. Enable UseGZfile and compress every stylesheet and javascript. Make sure the original files are kept, in case a browser doesn't support gzip.

Your URLtoolkit can be shorter by the way:
UrlToolkit {
ToolkitID = expires
Match .*\.(jpg|png|gif|css|js)$ Expire 1 weeks
}
Amar
8 May 2012, 23:00
I have

zlib.output_compression = On
zlib.output_compression_level = 6


already enabled

Thing is when I put nginx in front for static only and when I configure it to gzip stuff I see over 1MB less loading.

How do I do
and compress every stylesheet and javascript.
exactly? I do have UseGZfile = yes in hiawatha.conf

ty.
Hugo Leisink
9 May 2012, 02:02
Use the gzip tool to compress every .css and .js file. Make sure the original css and js files are still there. gzip removes them by default. Just copy them to a separate directory, gzip them and move them back.
Ginghong Wong
11 May 2012, 07:52
Gzip provides a "-c" option which could make it easier. "gzip -c php.js > php.js.gz" command will keep original files unchanged.
Patrick
4 August 2012, 19:28
Going off on a slight tangent, but there really is no need for nginx in front of Hiawatha. In fairly recent benchmarks we carried out Hiawatha is pretty much equal on serving static content and faster with anything dynamic. YMMV of course...
Hugo Leisink
4 August 2012, 19:39
Are you willing to share the results of that benchmark with us?
Patrick
4 August 2012, 21:22
Yeah, of course Hugo. I managed to find the results today.

Apache 2.2 Worker
Static Wordpress Drupal
1000/1 9.5378 24.719 21.2865
1000/10 3.0758 13.82933333 12.22625
10000/100 28.03933333 120.3565 105.312

Hiawatha 8.1
Static Wordpress Drupal
1000/1 8.97525 23.68833333 20.59933333
1000/10 3.2162 11.44075 10.27625
10000/100 30.98 56.132 54.391

Cherokee 1.08
Static Wordpress Drupal
1000/1 10.57666667 24.44033333 19.59875
1000/10 3.488 14.28125 10.8952
10000/100 30.673 115.179 99.157

Nginx 0.8.54
Static Wordpress Drupal
1000/1 8.697125 26.56325 24.11625
1000/10 2.91275 12.41575 11.44975
10000/100 27.879 90.518 103.529

Lighttpd
Static Wordpress Drupal
1000/1 9.0364
1000/10 2.98975
10000/100 27.46933333
Patrick
4 August 2012, 21:24
I never got the Lighttpd results completed, sadly. Tried exporting from Excel but it generated horrible dirty HTML.
Hugo Leisink
5 August 2012, 00:45
Thanks!
This topic has been closed.