Current time: 08-28-2014, 11:01 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hostgator and Compression
06-14-2010, 10:15 PM
Post: #11
RE: Hostgator and Compression
This is what I have Graham
Header unset ETag
<FilesMatch "\.(gif|png|jpg|jpeg|js|swf|bmp|ico)$">
ExpiresActive On
ExpiresDefault "access plus 2 years"
Header set Cache-Control "public, no-transform"
</FilesMatch>

<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 2 months"
Header set Cache-Control "public, no-transform"
</FilesMatch>
Find all posts by this user
Quote this message in a reply
06-26-2010, 02:55 AM
Post: #12
RE: Hostgator and Compression
(06-14-2010 10:15 PM)Dayton Wilks Wrote:  This is what I have Graham
Header unset ETag
<FilesMatch "\.(gif|png|jpg|jpeg|js|swf|bmp|ico)$">
ExpiresActive On
ExpiresDefault "access plus 2 years"
Header set Cache-Control "public, no-transform"
</FilesMatch>

<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 2 months"
Header set Cache-Control "public, no-transform"
</FilesMatch>

Hello Dayton. I inserted your code into my .htaccess file and, while it didn't do anything for my "NoEtags" score...it worked wonders for my "Cache Static Content" score. I thank you for the code.

Tom

Tom Naff
[url=http://www.naffs-kingdom-cat-shop.com]Naffs-Kingdom-Cat-Shop.com[/url]
[url=http://www.dog-beds-house.com]Dog-Beds-House.com[/url]
Find all posts by this user
Quote this message in a reply
06-26-2010, 03:01 AM
Post: #13
RE: Hostgator and Compression
(06-26-2010 02:55 AM)deking Wrote:  
(06-14-2010 10:15 PM)Dayton Wilks Wrote:  This is what I have Graham
Header unset ETag
<FilesMatch "\.(gif|png|jpg|jpeg|js|swf|bmp|ico)$">
ExpiresActive On
ExpiresDefault "access plus 2 years"
Header set Cache-Control "public, no-transform"
</FilesMatch>

<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 2 months"
Header set Cache-Control "public, no-transform"
</FilesMatch>

Hello Dayton. I inserted your code into my .htaccess file and, while it didn't do anything for my "NoEtags" score...it worked wonders for my "Cache Static Content" score. I thank you for the code.

Tom

Unless you're running a multi-server load balanced site (which you aren't on shared hosting) I wouldn't worry about looking at the ETags at all. It is only a potential problem for multi-server installs (not sure I even want to continue checking for it which is why it is not exposed in the main grades).
Visit this user's website Find all posts by this user
Quote this message in a reply
06-26-2010, 06:43 AM (This post was last modified: 06-26-2010 06:50 AM by deking.)
Post: #14
RE: Hostgator and Compression
(06-10-2010 11:47 PM)pmeenan Wrote:  Wow, that's almost criminal at this point. (sorry, was swamped so I didn't get a chance to reply to your earlier post).

Assuming you aren't willing to switch hosting providers at this point there are a few things you can do:

- Use a CDN for your static assets. Most will auto gzip for you (MaxCDN does and is quite reasonably priced)
- If you main page is php you can use php's built-in support for gzipping but that will only work for things that are php

Images don't get gzipped so you don't have to worry about those (though they would also benefit from being served from a CDN).

Do you pay for bandwidth at hostgator? If so I could see why they might not have incentive to enable compression because it would reduce the used bandwidth significantly. I know both Dreamhost and Bluehost support gzip and have it enabled by default.

Well...apparently they do. I just talked with Hostgators tech support (via chat) and was assured that they did, in fact, support both mod_gzip and gzip on their shared hosting servers. The guy then went on to say that "Compression would not really help loading speed. It is very situational, actually." Right then I knew I was in trouble. I said, "There seems to be a whole host of "geeks" online who disagree with you and swear that text compression will speed up loading time." Then he gave me a link to this site http://www.samaxes.com/2008/04/htaccess-...th-saving/ which contains some code snippets. I added the code for gzip to my .htaccess (attached here) and loaded onto my server...ran the test again and saw no improvement in the "Compress Text" score. Would you take a look at my .htaccess file and see if I made any errors. Many thanks.
.txt  htaccess code.txt (Size: 4.99 KB / Downloads: 4210)

Tom Naff
[url=http://www.naffs-kingdom-cat-shop.com]Naffs-Kingdom-Cat-Shop.com[/url]
[url=http://www.dog-beds-house.com]Dog-Beds-House.com[/url]
Find all posts by this user
Quote this message in a reply
06-26-2010, 07:56 AM
Post: #15
RE: Hostgator and Compression
(06-26-2010 06:43 AM)deking Wrote:  
(06-10-2010 11:47 PM)pmeenan Wrote:  Wow, that's almost criminal at this point. (sorry, was swamped so I didn't get a chance to reply to your earlier post).

Assuming you aren't willing to switch hosting providers at this point there are a few things you can do:

- Use a CDN for your static assets. Most will auto gzip for you (MaxCDN does and is quite reasonably priced)
- If you main page is php you can use php's built-in support for gzipping but that will only work for things that are php

Images don't get gzipped so you don't have to worry about those (though they would also benefit from being served from a CDN).

Do you pay for bandwidth at hostgator? If so I could see why they might not have incentive to enable compression because it would reduce the used bandwidth significantly. I know both Dreamhost and Bluehost support gzip and have it enabled by default.

Well...apparently they do. I just talked with Hostgators tech support (via chat) and was assured that they did, in fact, support both mod_gzip and gzip on their shared hosting servers. The guy then went on to say that "Compression would not really help loading speed. It is very situational, actually." Right then I knew I was in trouble. I said, "There seems to be a whole host of "geeks" online who disagree with you and swear that text compression will speed up loading time." Then he gave me a link to this site http://www.samaxes.com/2008/04/htaccess-...th-saving/ which contains some code snippets. I added the code for gzip to my .htaccess (attached here) and loaded onto my server...ran the test again and saw no improvement in the "Compress Text" score. Would you take a look at my .htaccess file and see if I made any errors. Many thanks.

Just FYI....I just finished talking at length by phone with Hostgator tech support and was assured that Persistant Connection - Keep Alive was enabled on their shared hosting servers by default. I steered him to your site and had him run the test for himself and, sure enough, he got the same results. No explanation for the low score for "Keep Alive" was forthcoming...a service tickets was started...more later.

Tom Naff
[url=http://www.naffs-kingdom-cat-shop.com]Naffs-Kingdom-Cat-Shop.com[/url]
[url=http://www.dog-beds-house.com]Dog-Beds-House.com[/url]
Find all posts by this user
Quote this message in a reply
06-26-2010, 12:46 PM
Post: #16
RE: Hostgator and Compression
Depending on the version of Apache they are using it will be mod_gzip (1.x) or mod_deflate (2.x). Looking at the response headers from your test earlier in the thread it looks like they are on 2.2.15:

Server: Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635

The <ifModule mod_gzip.c> is useless since 2.2 doesn't use mod_gzip.

For mod_deflate it should look more like this:

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

but that is assuming they have it installed (and given the quality of answers you have received so far I'd be worried).
Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2010, 03:31 AM (This post was last modified: 06-29-2010 03:32 AM by deking.)
Post: #17
RE: Hostgator and Compression
(06-26-2010 12:46 PM)pmeenan Wrote:  Depending on the version of Apache they are using it will be mod_gzip (1.x) or mod_deflate (2.x). Looking at the response headers from your test earlier in the thread it looks like they are on 2.2.15:

Server: Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635

The <ifModule mod_gzip.c> is useless since 2.2 doesn't use mod_gzip.

For mod_deflate it should look more like this:

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

but that is assuming they have it installed (and given the quality of answers you have received so far I'd be worried).

Finally...a definitive answer from Hostgator. Here's what they said: "As you can see at http://support.hostgator.com/articles/pr...chnologies mod_gzip and mod_deflate are only for VPS and dedicated servers. It is not best to use persistent connections as they are set to be killed off if they go over 15 seconds though you are able to change this on VPS and dedicated servers." Obviously the tech support team missed that memo. Blush

Needless to say, I'm currently host shopping. Many Thanks.

Tom

Tom Naff
[url=http://www.naffs-kingdom-cat-shop.com]Naffs-Kingdom-Cat-Shop.com[/url]
[url=http://www.dog-beds-house.com]Dog-Beds-House.com[/url]
Find all posts by this user
Quote this message in a reply
08-09-2010, 03:10 AM (This post was last modified: 08-09-2010 03:11 AM by Marlon.)
Post: #18
RE: Hostgator and Compression
Wow, I added the cache code in my htaccess with modification to plus 1 month and BAM - almost an immediate page load on return. Thanks so much for sharing. I assume if changes are made to the web page, these changes can be seen within the cache expiration date (eg user visits today, website has a change later today, user visits tomorrow and then see the modification made to the site).
Find all posts by this user
Quote this message in a reply
08-09-2010, 04:38 AM
Post: #19
RE: Hostgator and Compression
Depends on the change and how your site works. If a given file (image, css, javascript) changes and is set to cache then the users will NOT see the change and could potentially experience a broken site.

You need to change the file name of resources for users to get the updated version. Most plugins that do the acceleration for you will take care of it automatically but if you just manually set the expiration in .htaccess you should change it back until you fully understand the ramifications for your site (images are usually not a problem - though logos sometimes change - css and javascript are usually the ones you want to watch out for).
Visit this user's website Find all posts by this user
Quote this message in a reply
08-09-2010, 07:37 AM
Post: #20
RE: Hostgator and Compression
Thanks Patrick. Text will probably the major changes on the pages and with this htaccess setup, you'd say the users will see the changes?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)