Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 09:47:11 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155535 Posts in 21713 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: [Solved] Enable Gzip compression?  (Read 1574 times)
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« on: March 18, 2010, 12:04:15 AM »

Hi there,

Is there any way (how) to enable Gzip compression within wb in order to load pages faster?

Boudi
« Last Edit: March 18, 2010, 10:19:23 AM by Boudi » Logged

...:: Bake the Unbakable ::...
albatros

Offline Offline

Posts: 674


WWW
« Reply #1 on: March 18, 2010, 12:11:09 AM »

Hi,

I reallly don't know if it makes sense, but perhaps this could be a way http://farhadi.ir/works/smartoptimizer

hth

albatros
Logged
WB-Boosta

Offline Offline

Posts: 72



WWW
« Reply #2 on: March 18, 2010, 01:47:30 AM »

Sounds cool (although on a Drupal-site), any experiences yet?
What about gzip-enabling within .htaccess?
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #3 on: March 18, 2010, 10:21:31 AM »

@ Albatros, thnq for your url. Looked at it but was indeed looking for a more htaccess minded thing Smiley
@ Boosta:

create htaccess and put the following lines in:

Code:
<FilesMatch "\.(ico|flv|jpe?g|png|gif|js|css|swf)$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
</FilesMatch>

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

With this code you:

- enable the Gzip compression
- clear browser cache

In my case the page speed speeded up to 93/100 score  grin
Logged

...:: Bake the Unbakable ::...
WB-Boosta

Offline Offline

Posts: 72



WWW
« Reply #4 on: March 18, 2010, 06:45:02 PM »

Hhm,
Code:
<FilesMatch "\.(ico|flv|jpe?g|png|gif|js|css|swf)$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
</FilesMatch>
shows a 404-site.

Is there any change? I notice nothing. But perhaps the browser caches all pages? YSlow does not notice then?

In any case, I've cleaned up my CSS, switch the jQuery-UI off and save a lot of weight.
« Last Edit: July 13, 2010, 09:44:53 AM by WB-Boosta » Logged
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #5 on: March 18, 2010, 09:01:05 PM »

works, maybe 4u2. but need e.g. xxx.js AND xxx.js.gz

Code:
# Compress .js and .css files
AddEncoding gzip .gz
<FilesMatch "\.js\.gz$">
AddType "text/javascript" .gz
</FilesMatch>
<FilesMatch "\.css\.gz$">
AddType "text/css" .gz
</FilesMatch>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} \.(js|css)$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]

http://www.websitebaker2.org/forum/index.php/topic,17350.0.html

dbs
« Last Edit: March 18, 2010, 09:35:21 PM by dbs » Logged

Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #6 on: July 13, 2010, 01:31:21 AM »

Hhm,
Code:
<FilesMatch "\.(ico|flv|jpe?g|png|gif|js|css|swf)$">
ExpiresActive On
ExpiresDefault "access plus 1 month"
</FilesMatch>
bringt mir eine 404-Seite.

Ob sich durch die anderen Zeilen etwas ändert? Ich merke nix. Aber vielleicht cacht der Browser alles Seiten? YSlow merkt es dann nicht?

Auf jeden Fall habe ich meine CSS aufgeräumt, die jQuery-ui deaktiviert und eine Menge Gewicht eingespart.

Please talk English in this forum. Thanks.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #7 on: July 13, 2010, 01:34:53 AM »

Tonight I just stumbled upon a little piece of htaccess code that uses the deflate function to dynamically compress files. It makes my pages typically around 70% smaller!! Why I only just now learned about dynamic compression is a mystery to me... I guess a lot of people just don't know about this!

Add this to your .htaccess file:

Code:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

It seems to do about the same as the code mentioned above. So I don't know the difference. This code seems cleaner and easier to understand anyway.

You can check your old and new page size at http://www.whatsmyip.org/http_compression/
« Last Edit: July 13, 2010, 01:39:33 AM by Argos » Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #8 on: July 13, 2010, 08:37:38 AM »

Hi Argos,

Thnx for the code.

I'm always interested in speeding up websites. I tried your code but testing it afterwards with Firefox Firebug there seems no faster loading at all.

Your link gives indeed a fictional new improved result but again, with the firebug I don't see any differences...

Does anyone?

Boudi
Logged

...:: Bake the Unbakable ::...
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #9 on: July 13, 2010, 10:45:24 AM »

I'm not sure why firebug doesn't show speed increase.

It's not fictional, it's real. You can also check with the W3C validator, it clearly shows big page load improvements.

Or try
http://www.iwebtool.com/speed_test
http://www.websitegoodies.com/tools/speed-test.php
http://tools.pingdom.com
and other speed and page load test sites.

Also check out http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html to read about speed becoming more important for Google ranking.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #10 on: July 13, 2010, 10:55:05 AM »

Quote

Tried all of them and they all give me the 'old' size of the website. So in my case it's still fictional Sad
Logged

...:: Bake the Unbakable ::...
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #11 on: July 13, 2010, 10:56:49 AM »

Then your server doesn't support compression I guess... Check it with a info.php file.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #12 on: July 13, 2010, 12:11:09 PM »

Web compression is enabled.

This is what I get now with whatsmyip.org:

Original Size: 17.07 KB
Gzipped Size: 3.95 KB
Data Savings: 76.86%

This means that the loading size now is 3.95 kb?

Because when doing a test on websitegoodies.com I get this result:

Load Time:    1.379 seconds
Page Size:            17.07 kb

So what's the real size now? huh smiley





Logged

...:: Bake the Unbakable ::...
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #13 on: July 13, 2010, 12:56:53 PM »

Websitegoodies is a speed test that apparently shows the uncompressed page size. Whatsmyip is a page weight test.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #14 on: July 13, 2010, 01:11:51 PM »

Then is it actually working then? If all speedtestpages shows the uncompressed 17 kb and the FF extension Firebug doesn't give any faster results before/after inserting the htaccess code, then it seems that it isn't actually working?

Is it possible that it's more a theoretical number on whatsmyip.org?

Does it really work on your website(s) then?

Boudi
Logged

...:: Bake the Unbakable ::...
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #15 on: July 13, 2010, 01:22:25 PM »

I don't know Boudi, I see the results on whatsmyip.org, I see big page size decreases, and I really notice speed improvements on some sites, so I guess it's working.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #16 on: July 13, 2010, 01:34:48 PM »

I placed it on some heavy sites and you are right. It seems loading even more faster.  grin

Thnq for sharing this piece of code. Speed is good for SEO Smiley

Boudi

Logged

...:: Bake the Unbakable ::...
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!