Site speed boost in 5 minutes

11 replies
  • WEB DESIGN
  • |
As a result of recommendations made by Google PageSpeed Tool, PingDom and Yahoo’s ySlow extension, I’ve just implemented some htaccess changes as well as gzip compression on my live demo server.

I’m seeing a dramatic overall speed increase from the server across all my live demo websites.

Here's the PingDom test results after optimizations:



My “PageSpeed” and “ySlow” scores have all bumped up as well. They were already pretty good, but I’m constantly trying to optimize for speed and every little bit helps. Especially as more and more users connect to the web over mobile.

IMPORTANT: This tip involves editing the htaccess file. Editing the htaccess file takes some care. Make sure you create a backup copy of your site (or at least your htaccess file) before making any changes. Also, immediately test your site after making changes. If you have active plugins, its a good idea to disable them before making htaccess changes in order to avoid conflicts or potential server errors.
The most dramatic impact can be made simply be adding a few lines to your htaccess file. This file is usually located inside your site’s “root” directory and is just named "htaccess" with no file extension (you may need to adjust your FTP program's preferences to be able to view files of this type).

For example, to address pagespeed/ySlow nags on “gZip Compression, “Expires headers” and “eTags“, I’ve added the following to the top of my htaccess files on all my demo sites:

Code:
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-javascript application/javascript text/javascript text/css

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
        ExpiresActive On
        ExpiresDefault "access plus 1 year"
</FilesMatch>

Header unset ETag
FileETag None
After applying those settings and updating your htaccess file on your server, you should be all set. However, if, after several hours, the tools are still reporting that your files are not compressed, you may go a bit further as follows:

How to Enable GZIP Compression on your webserver via cpanel

Login to cPanel account for the user account which GZIP compression wants to be turned on. Then click on Optimize Website under Software / Services.

User will be presented with options to compress all content or compress the specified MIME types, with a text box to specify file types to compress is selected (default is text/html text/plain text/xml). Choose either one setting to enable GZIP compression on all websites hosted by the particular account. Click on Update Settings when done.



As you can see from the screenshot above, I’ve chosen these mime types to compress on my server at clickbump.com

text/html text/plain text/xml text/javascript text/css

Tip: Possible MIME types include text/html, text/plain, text/xml, text/css, text/javascript, application/javascript, application/xhtml+xml, application/xml, application/rss+xml, application/atom_xml, application/x-javascript, application/x-httpd-php, application/x-httpd-fastphp, application/x-httpd-eruby, and image/svg+xml.

In conclusion

These are some quick tips that you can implement that should dramatically increase your overall server speed and performance. Once you have these in place, you can look to your site's theme or template for further optimizations. Here are 3 that you should consider first:

1) Optimize your site's images with a tool like this > PunyPNG - PNG Compression and Image Optimization - Gracepoint After Five

2) Combine your css scripts into a single file and minify them to remove white space, line breaks and comments

3) Move your scripts to the footer of your theme, just before the closing body tag
#boost #minutes #site #speed
  • Profile picture of the author jamaks
    Hi, thanks for tips and the links. Shall bookmark this post and may come back with questions at some point. Regards. Jim
    {{ DiscussionBoard.errors[6815417].message }}
  • Profile picture of the author durseo
    site speed is important for SEO.
    {{ DiscussionBoard.errors[6815559].message }}
  • Profile picture of the author Baadier Sydow
    Thanks for the tips, I was considering going the CDN route for a performance boost but with what I consider to be relatively low traffic it would have been an overkill.
    {{ DiscussionBoard.errors[6816038].message }}
    • Profile picture of the author clickbump
      Originally Posted by Baadier Sydow View Post

      Thanks for the tips, I was considering going the CDN route for a performance boost but with what I consider to be relatively low traffic it would have been an overkill.
      Hi Baadier, CDN is a definite help if you have lots of images on your site, but as you indicate, there's a few super simple and easy steps you can take before going there.

      You'll notice immediate and dramatic speed improvements with these simple tweaks. By far the biggest bang for your buck of any optimization steps you could do with such minimal effort.
      Signature
      {{ DiscussionBoard.errors[6816285].message }}
  • Profile picture of the author rhinocl
    For some reason I had to remove everything from your code before Expires on to prevent '500' error.
    {{ DiscussionBoard.errors[6831915].message }}
    • Profile picture of the author clickbump
      Originally Posted by rhinocl View Post

      For some reason I had to remove everything from your code before Expires on to prevent '500' error.
      Thanks for the heads up. It looks like the forum editor had bungled my code a bit and escaped a few characters incorrectly. The corrected code should be:

      Code:
      AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml+xml
      AddOutputFilterByType DEFLATE application/x-javascript application/javascript text/javascript text/css
      
      <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
              ExpiresActive On
              ExpiresDefault "access plus 1 year"
      </FilesMatch>
      
      Header unset ETag
      FileETag None
      Signature
      {{ DiscussionBoard.errors[6832206].message }}
  • Profile picture of the author willyboy104
    Thanks for this.

    May I ask what the code in the HTA Access file is supposed to do?

    Also, everything above expires I also had to remove because it made every page after my main domain name go to a 404 error page.
    Signature
    If you want to learn how to make money online, no bullshit click here.
    {{ DiscussionBoard.errors[6863548].message }}
  • Profile picture of the author jamaks
    Hi, had slight problem with the code myself but found that closing it with </FilesMatch> seems to solve the problem. Had a frustrating few hours trying to comply with the Google insights recommendations but now have a pingdom score of 100/100 Thanks again for pointing me in the right direction. Jim
    {{ DiscussionBoard.errors[6863619].message }}
  • Profile picture of the author willyboy104
    OK so now it works, but I don't see a noticeable difference in my site speed.
    Signature
    If you want to learn how to make money online, no bullshit click here.
    {{ DiscussionBoard.errors[6865882].message }}

Trending Topics