diy niche building toolsrankspanker serviceniche basic

Speeding Up A WordPress Site – Step by Step

I think we can all agree that regardless of the fact Google using speed as a ranking factor, it will help us to learn how to speed up our websites.

In this post – that will be updated several times – I am going to take a very systemic approach to finding bottlenecks. From the DNS, to server, to WordPress, Plugins, Images and everything else that could affect your sites speed.

[Day 1 - Test Your DNS] [Day 2 - Base WordPress Installation]

The First Test – Trace Route and Eliminate the DNS


I do my ping and trace from the command prompt in windows, but there are some websites that will help look up bottlenecks as well. For online lookups, you can skip right over ping (if the site is resolving already) and just go to a Traceroute at DNSStuff

Edit: The more I looked at the DNSStuff tool – its located on a hostgator server, or planet server! If you use HG, it wont do you any good! If anyone uses online tracert tools, please share below. Doh…

In case you are wondering, a Traceroute (Wiki link) is like measuring the amount of time it takes, in milliseconds, for your request to resolve. Think of it like dialing the telephone… the Traceroute begins when the last number is dialed on your end <begin trace>……………….. <end trace> and the FIRST RING on the other end.

In that very short time, you will see how long it takes for each connection, or hop, from point A to the destination, your website. You will see in the image below, by trace to thenichestorebuilder.com, took a total of 8 hops, and there were no bottlenecks in the DNS system at the time of the trace.

  1. Enter your domain into the center box, Traceroute.
  2. Press the little arrow to execute the trace
  3. Review the results (See image) paying attention to the “Best and Graph” section.

If there are any LONG delays in these two columns, and by long… I mean, longer than 1 second (Not millisecond)… it WILL JUMP out at you and you wont need to question the results, or how fast, etc… believe me, if its slowing down, you will see it immediately!

Anyhow – if there are ANY bottlenecks, you need to contact your hosting provider and simply ask: “Why is my site responding slowly to a traceroute?”

Don’t waste your time sending them your trace results, they will have you do another, on one of their own trusted clients.

Once we have eliminated the DNS system as a bottleneck, we can move onto the next logical source of slowdowns, the content of the website. In this case, I am going to focus on WordPress.

Optimize The Base WordPress Installation


Continuing along on our trek to make WordPress a superfast app… e need to have a clean installation of wordpress, and before we do anything else, make sure it is configured properly to serve up our content in the fastest ways possible!

To test all changes, I am using the YSlow plugin for Firefox. While I do have the Speed test by Google plugin installed, I don’t use it. i am just anti-google I guess.

Starting with nothing… Click the images to enlarge if you need to…

1 – Baseline Domain At Web Host – Score 100, A

  • Checked DNS and YSlow, got an A with nothing there! Doh!

2 -  Installed WordPress through cPanel – Score 87, B

  • Logged into cPanel
  • Used Fantastico to Install WordPress 2.9.2
  • Checked Speed in YSlow

3 – Install & Configure Cache Plugin – Score 95, A

  • Installed and configured WP-SuperCache (recommended by HostGator), No Change in score or speed. Uninstalled it, cleaned cache, deleted folder. Removed any trace of the plugin.
  • Installed and configured the W3 Total Cache plugin (Recommended by Rochelle) The base installation (install and activate) of the plugin saw a +2 point increase from an 87 score, to an 89 score. In order to configure the plugin, I:
    1. Went to “Page Caching” setting, cleared checkbox for “Don’t cache pages for logged in users”, clicked on save. (I wanted to make sure I see cached results)
    2. Went to the “Minify” setting and added the themes css file to the “Cascading Style Sheet”, “File Management” section, and saved changes. (To cache the stylesheet of the default theme)
  • Done in the settings….

At this point, there are three settings on the site that are hurting the score in YSlow,I got an F for:

  • F – Use Content Delivery Network
  • F – Add Expires Headers
  • F – Configure Entity Tags

I am not going to claim to know what all this crap means… but I did find the solution at Tips and Tricks HQ! :-)

  • I chose to do nothing about CDN (Content Delivery Network) without getting a cloud account like Amazon S3 somewhere. Skipped.
  • To eliminate the Expiry Headers F, in your cPanel file manager or favorite text editor, open the htaccess file and add the following just ABOVE the #Begin WordPress entry:

# Expire images header
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
# End Expiry

Save and leave open.

  • To eliminate the Entity Tags F, in your cPanel file manager or favorite text editor, open the htaccess file and add the following just ABOVE the #Begin WordPress entry:

#eTag Entity
FileETag none

Save and Close.

  • In your WordPress admin, revisit the W3 Total Cache plugin page and clear your cache, close your browser, and reopen it to your sites homepage. When you test in YSlow, your base WordPress install should get a much more desireable, A. :-)

WordPress Optimized for Speed

Now that our WordPress installation is optimized for speed, we get the fun task of dealing with plugins, themes, etc.

In the next installment to this page, I am going to install my base plugins and theme, testing the speed every step of the way!

Previously Published Articles You May Like to Read:


Rate This Post

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

26 Comments »

  • Bill said:

    Nice
    Fyi I tried implimenting gzip.
    HG does not have it on servers.
    I will be doing this asap

  • Mark Hansen (author) said:

    You can get gzip working Bill… It will actually be covered in the next installment, which will be part of this same post.

  • David said:

    Mark,

    What does it mean if I only got 6 hops..is this better than 8 hops.. are more hops better…

  • Mark Hansen (author) said:

    @David – Shorter is generally quicker, but its truly just a reflection of where you are in relation to the web server.

    Someone in Spain might have 25 hops to the server… etc

  • cathy said:

    This is great information. I will look forward to the follow up posts in this series.

    I’ve just put a caching plugin onto one of my thesis blogs. What is
    your favorite…and can you do a post on how to do the settings? It always gets me a bit confused.

    Thanks again,

    Cathy

  • Ottidid said:

    The W3 Total Cache plugin seems to be just what I needed. After trying the wp super cahse and ezgz and smush it. then finally this one. I really noticed a difference.. thanks for the great posts on this technical subject…

  • Mark Hansen (author) said:

    @Ottidid – After you config the plugin … it simply ROCKS! Better results than wp-super-cache on my end with it.

    M

  • Rochelle said:

    Mark,

    Several of my sites use ReviewAZON, phpBay Pro, and phpZon. Items change frequently as a result of these plugins, including images. Will adding the “# Expire images header” code to .htaccess have any negative implications if we have the above listed plugins activated on a WP site?

    Rochelle

  • Rochelle said:

    Oh, one more thing. Will you please give the exact setting you use to add your style.css to the minify settings? I did what I think is correct, but when the plugin validates the URLs, I see a 404 error.

    Rochelle

  • Mark Hansen (author) said:

    @Rochelle – In ref to the images… its based on name also Rochelle, so unless all the images are named the same, I assume it would be fine. (I could be wrong on this… )

    As far as the exact setting is VERY and 100% dependent on the name of the css file in your theme. You are one day ahead of where I am, and I will walk through this in detail, once I install a theme.

    To give you a head start though…

    I used the YSlow to ID and walk through each of the file names and add them to my settings.

    W3 Settings > Minify > (Both the JS and CSS sections)
    Click on the “Add a Script” or/and “Add a Style Sheet” button and put in the full URL to the .js or .css file, and save the page.

    I do all of them at once, and save the entire thing one time.

    M

  • Ross said:

    Mark,

    http://www.askapache.com/ has a good deal of info and code examples for hacks to your .htaccess file to increase speed. I bumped about 1 second off my load time implementing all of the changes.

    -Ross-

  • Cherie said:

    If you don’t know what all the things mean that are returned by Yslow, have a look at yahoo developer network, it gives some explanations (I knew hardly any of them, I’m ashamed to say) Here’s the link http://developer.yahoo.com/performance/rules.html#dns_lookups

  • Mark Hansen (author) said:

    @Ross – Great find Ross!

    @Cherie – Same Cherie!

    I will have to assemble the links within the post on the next update.

    M

  • Josh said:

    @Mark – a tracert to your site from Madrid, Spain is actually 13 hops, not 25 :P

  • Cherie said:

    I’m sorry but I don’t get “added the themes css file to the “Cascading Style Sheet”

    I tried looking at the YSlow but there seems to be masses of code and I’ve no idea what I’m looking at. could you please give a generic example?

    thanks

  • Cherie said:

    I uploaded the w3 total cache and put in those edits into the htaccess file but I’m still getting and F for Add Expires Headers. Do you know why it hasn’t worked?

    thanks

  • Mark Hansen (author) said:

    @Cherie – View your site and go to the YSlow screen.

    If you click on the second tab, labeled “Components”, the third choice on that screen are the css files.

    Click the + sign to the left and it will expand and show you ALL css files being called by the current page.

    Copy the URL of the css file (make sure its NOT a .php file, but a .css file) and add it to the W3 Cache > Minify Settings > Cascading Style Sheets section in the plugin panel. It will now minify and cache your css file.

    @Cherie – You MAY actually get an F if you have a lot of OFFsite files also. You can only control what is ON your site.

    Mark

  • Cherie said:

    Thanks very much Mark – 1 more thing do we enable the HTML minify settings?

    thanks

  • Cherie said:

    Oh fantastic, from grade D to A

  • Mark Hansen (author) said:

    @Cherie – I do for sure Cherie.

    Glad to hear about the A!

  • John Timberlake said:

    Hey Mark,

    Have you found any lightning fast wp-themes that are seo friendly ? I can get a 95 score with yslow using the default kubric theme. when I try any of the themes I’m using nowdays,like flexx2 the score plummets down to the 75/85 range and I haven’t even started with the plugins yet.

    Thanks,
    John

  • Mark Hansen (author) said:

    John – I am using Flex2 on many sites and get a Yslow 95 with it. 9 Plugins, theme header, all loaded and running.

    I will update this post today – to reflect the settings.

  • John Timberlake said:

    @Mark Hansen

    Thanks for the feedback…here’s the deal. made the .htaccess edits on a new wp install using the kubric theme/ 2 plugins (askemit and w3 total cache, configured as you suggested).Scored 95 w/ B compress components with gzip and E for CDN then I activated Flexx2 – green

    Reportcard

    B make fewer http rquests
    F CDN
    F Add expire head
    F Compress comp. w/ gzip
    B Put javascript at bottom

    It seems that the functions in wp3 cache stopped working when I switched themes…. a screw up in my .htaccess editing ? I’m stumped.

    I tried swapping out super cache with wp3 total cache, doing the .htaccess edit on a fully built site and basically get the same report card.

    I also double checked yslow by running the first site through webpagetest.org and it’s the same story. It’s as if the benefits I get from using w3 total cache stop working when I change themes, hmmm.

    Any ideas ?

    Thanks,
    John

  • Speeding Up WordPress – Day 2 | Niche Store Builder said:

    [...] Follow along as we  learn to Speed Up WordPress [...]

  • How to Add a Facebook Like Button to WordPress Posts | Niche Store Builder said:

    [...] “Like” button, the last thing I wanted was another plugin! As I have been working on Speeding up WordPress, I found that plugins are the biggest hog of resources… so instead of another one, I chose to [...]

  • Trying to Make it Easier to Navigate Long Articles! | Niche Store Builder said:

    [...] around Speeding up a WordPress Site, and thus far, I have completed two sections of the article, testing the domain at the server, and the Optimizing the Core Install of WordPress. In the next segment, I am going to [...]