PDA

View Full Version : Page compression on 1&1


animal dreams
10-Jan-2010, 02:19 PM
With Google now adding page load speed to their ranking algorithm, does anyone know how to get gzip working on 1&1. I've tried every suggestion I can find on web but all seem to give 500 server error.

1&1 suport will only confirm that gzip is enabled but will not give any assistance in configuration of htaccess etc. (job's worth!!!) :mad:

Anyone sorted this?

Duncan Rounding
10-Jan-2010, 04:53 PM
If you are referring to getting v9 compression working in the network settings then it shoujd just work automatically with 1and1, there's nothing else to do.

I believe all my 1and1 hosted sites work with compression without any htaccess config etc.

pinbrook
10-Jan-2010, 07:28 PM
i think you are talking about this

http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression

cant help with 1&1 though :o

animal dreams
11-Jan-2010, 06:44 AM
Yes. That's what I am talking about Jo.

Anyway found a solution here for anyone else with same issue:
http://mrrena.blogspot.com/2009/01/how-to-compress-php-and-other-text.html

robmob
07-Feb-2010, 10:57 AM
I am not on 1and1 but would like to get gzip working for our site as the stats in Google webmaster tools are showing that it is relatively slow.

I have come across the following:

http://www.blog.highub.com/apache/http-server/htaccess-gzip-for-faster-loading-and-bandwidth-saving/

which states:

If you can use htaccess on your server and want to use gzip for faster Page Load Times / Bandwidth Saver. You can put the following lines in the htaccess file on your server:


<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|jpg|png|gif)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>


Would this be safe to add to our htaccess file for our actinic site on Apache/2.2.3 server.

Thanks

Golf Tee Warehouse
07-Feb-2010, 03:58 PM
When I looked around the net I came across dozens of different variations, but the one I used was to add the following into the .htaccess file

# compress all text, js, css & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript

robmob
07-Feb-2010, 04:22 PM
Thanks Darren

Do you paste it in just a shown in your post?

Golf Tee Warehouse
07-Feb-2010, 04:36 PM
Yes, that's what I have done
The first line is not really required, but is a comment line stating what the following line does so in the future you have a chance of remembering.

robmob
07-Feb-2010, 05:11 PM
Darren

Brilliant

Seems to be working perfectly.

Thanks for your help on this one.

Mike Hughes
08-Feb-2010, 08:20 AM
Has anyone any figures on how much difference gzip has made to their own site on webmaster tools? Does the graph show a significant improvement?

The other thing I'm wondering about is blocking Google from the cgi-bin (as long as you aren't linking pages via the scripts). Pages served via the scripts are all going to be slower than straightforward html pages. Those that are just doing a re-direct shouldn't be too bad. The cart and checkout pages might appear slow though.

Mike

Golf Tee Warehouse
08-Feb-2010, 09:10 AM
Robert,

I have updated the line of code to add into the htaccess file in my earlier post as on checking today I see that the javascript files were not being compressed as I had used text/javascript and seems I should have used application/x-javascript (although I have seen both 'application/x-javascript' and 'application/javascript' and may depend on your server - probably nest to test both). I am sure it was working when I tested it last month.

I have used http://www.gidnetwork.com/tools/gzip-test.php ro check eash file type. Don't just enter the home page url as they will only test the html files, I would suggest entering the direct url of a css file and a js file to check that css files and javscript files are also working.


Mike,

I implemented Gzip around 1 month ago and also removed a lot of excess code from my actinic.css file but neither has resulted in any apparent improvement on the graphs in Google Webmaster Tools.

I block google's access to the CGI-BIN in my robots file, although the reason was to encourage google to index the proper URL of a product rather than it's cgi-bin link it was oicking up from best sellers and new product lists.

fergusw
08-Feb-2010, 10:38 AM
Google's Page Speed recommendations are very interesting indeed and are based on improving the speed and delivery of your website from server to browser, including the rendering speed of the HTML and code in the browser as well.
GZIP compression is just one aspect.
Another element to look at is utilising browser caching (http://code.google.com/speed/page-speed/docs/caching.html). This reduces overall load times and helps with website performance as well:

You can implement browser caching through the htaccess file as well with something like:

# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch ".(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch ".(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch ".(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store,
proxy-revalidate, no-transform"
Header set Pragma "no-cache"

</FilesMatch>

We always recommend that the first priority is to optimise the existing HTML, CSS, images and javascript on your website so that you get the best possible performance prior to any compression or caching.
We have seen some significant improvement in websites who have had their HTML/CSS overhauled with properly optimised images and CSS and javascript code as opposed to those sites that only implement GZIP or caching.
The rendering speed in the browser can be significantly improved asl well, which all adds up to a better experience for the customer.

Golf Tee Warehouse
08-Feb-2010, 10:53 AM
We have also set-up browser caching (hopefully correctly) and have added the following to the htaccess file, although were undecided exactly what values to use.

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 12 hours"
ExpiresByType image/jpeg "access plus 12 hours"
ExpiresByType image/png "access plus 12 hours"
ExpiresByType image/ico "access plus 4 months"
ExpiresByType text/css "access plus 4 hours"
ExpiresByType text/javascript "access plus 2 weeks"
ExpiresByType text/xml "access plus 4 hours"
</IfModule>

Most of our images should already be optimized and are page load speeds seem to be fairly decent when I have compared them to our competitors as we are usually the first or second fastest when compared to our top 8 competitors.

Duncan Rounding
08-Feb-2010, 11:37 AM
How does this compare to the standard browser caching which generally works on size rather than duration? Does it override it?

Mike Hughes
08-Feb-2010, 12:10 PM
I think the 'expires' stuff only tells the browser how long the content is valid for.

The browser will still use it's own cache settings, but might fetch fresh data if the content expiry time is earlier than the cache setting.

Mike

cbarling
08-Feb-2010, 03:30 PM
... page load speeds seem to be fairly decent when I have compared them to our competitors ...

Of course one of the things that doesn't get mentioned that often is that when Actinic is serving vanilla HTML files it will always be faster (all other things being equal) than a database driven site.

Chris

robmob
20-Feb-2010, 09:19 AM
Just thought I would report back after a couple of weeks of having implemented gzip via the .htaccess file. In the Google Webmnaster Tools Site Performance Section I can see an improvement in page load speed by a factor of 3.

However what is worrying and I am not sure if it is related my indexed pages count has reduced from approx 1000 pages to nearer 250 - we have not made any other changes to the site in last last two weeks and not made any changes to our sitemap either.

Could this be related? - strange how it happened at the same time.

robmob
20-Feb-2010, 11:52 AM
Some more interesting stats comparing the week before and the week after shows a 28% increase in organic google traffic and 6% improvement in bounce rate.

alexwren
22-Feb-2010, 05:01 PM
Rob,

According to Firebug it reckons you don't have gzip enabled. Did you turn it off or was there another reason for it not being on anymore? I am also interested to hear more about your stats on Webmaster tools. Can you tell me what the average load time was in the diagnostics graph?

Alex

Golf Tee Warehouse
22-Feb-2010, 05:34 PM
Alex which site have you tested, as I have just checked the performancemotorcare.com site and for me Firefox PageSpeed plugin has a green tick for 'Enable Compression'
and both http://www.dnsqueries.com/en/check_http_gzip.php and http://www.gidnetwork.com/tools/gzip-test.php indicate the gzip is enabled and working.

I don't believe gzip is enabled on the other site in his signature 'clicktorch.com'.

robmob
23-Feb-2010, 06:35 AM
Alex

Darren is correct - only have it on the performancemotorcare site.

I will PM you on some of the other info.

robmob
26-Feb-2010, 06:37 PM
Just another quick update. I am pleased to say our indexed page numbers have gone back up to their previous level so i assume unconnected with anything we did with implementing gzip. The visitor numbers have also remained at the increased level.

Now just need to take a look at the browser caching suggested earlier.

Hope this helps.

globalee
29-May-2011, 04:51 PM
Google's Page Speed recommendations are very interesting indeed and are based on improving the speed and delivery of your website from server to browser, including the rendering speed of the HTML and code in the browser as well.
GZIP compression is just one aspect.
Another element to look at is utilising browser caching (http://code.google.com/speed/page-speed/docs/caching.html). This reduces overall load times and helps with website performance as well:

You can implement browser caching through the htaccess file as well with something like:

# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch ".(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch ".(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch ".(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store,
proxy-revalidate, no-transform"
Header set Pragma "no-cache"

</FilesMatch>

We always recommend that the first priority is to optimise the existing HTML, CSS, images and javascript on your website so that you get the best possible performance prior to any compression or caching.
We have seen some significant improvement in websites who have had their HTML/CSS overhauled with properly optimised images and CSS and javascript code as opposed to those sites that only implement GZIP or caching.
The rendering speed in the browser can be significantly improved asl well, which all adds up to a better experience for the customer.

Hi fergus, I have noticed that when implementing deflate in the htaccess file it causes the SSL certificate to fail when on secure pages, any ideas? (i have removed the compression for now)
CHeers, Lee