DMS 2 Speed Up Your DMS Site - Little Tip I Learned


7 posts in this topic

Posted · Report post

Just had a chat with tech support and while most of us use caching plugins for Wordpress, I got a little tip (sure the super techies here already know this) but I can admit I didn't.  He gave me some commands to add to the .htaccess file of my domains root directory that I build sites off of as well as my own sites and it definitely speeds things up tremendously.

 

I just added the below code to the top of my .htaccess file (I know this is a file most shouldn't mess with) but I added this code exactly as it appears.  Just figured I'd share with anyone who may have issues with site loading speeds.  I'm with Hostgator and typically don't have issues (been with them for years) but felt I had to share this for those who haven't tried before:

 

CODE:

 

 

<IfModule mod_deflate.c>

SetOutputFilter DEFLATE

<IfModule mod_setenvif.c>

# Netscape 4.x has some problems...

BrowserMatch ^Mozilla/4 gzip-only-text/html

 

# Netscape 4.06-4.08 have some more problems

BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine

# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48

# the above regex won't work. You can use the following

# workaround to get the desired effect:

BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images

SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

</IfModule>

<IfModule mod_headers.c>

# Make sure proxies don't deliver the wrong content

Header append Vary User-Agent env=!dont-vary

</IfModule>

</IfModule>

 

<IfModule mod_expires.c>

# Enable expirations

ExpiresActive On

# Default directive

ExpiresDefault "access plus 1 month"

# My favicon

ExpiresByType image/x-icon "access plus 1 year"

# Images

ExpiresByType image/gif "access plus 1 month"

ExpiresByType image/png "access plus 1 month"

ExpiresByType image/jpg "access plus 1 month"

ExpiresByType image/jpeg "access plus 1 month"

# CSS

ExpiresByType text/css "access 1 month"

# Javascript

ExpiresByType application/javascript "access plus 1 year"

</IfModule>

 

7 people like this

Share this post


Link to post
Share on other sites

Posted · Report post

How much of an speed increase you have noticed by modifying the htaccess? (I also use hostgator)

Share this post


Link to post
Share on other sites

Posted · Report post

How much of an speed increase you have noticed by modifying the htaccess? (I also use hostgator)

After the first couple of times I refreshed a site, if it took 7-9 seconds before, it now takes 2-3 at most.  Definitely noticeable.

Share this post


Link to post
Share on other sites

Posted · Report post

That's quite a big difference, there's a site  I ran into when talking into hostgator (http://gtmetrix.com/)  tells you where the performance is hurting.

 

Is there somewhere I can read this off source so I can know what each command does by any chance?

Share this post


Link to post
Share on other sites

Posted · Report post

How cool is that? Works like a charm! Thanks Big Guy. 

2 people like this

Share this post


Link to post
Share on other sites

Posted · Report post

Not sure how this works, but it made a 7 second average load time into maybe 3 seconds tops. Thanks alot. Going to use this across all my clients sites!

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

Did you have to remove any of the "other" code in the .htaccess file? I just added it to the bottom and haven't noticed any difference.

 

thanks,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now