• 0

The quest for speed.


Question

Posted · Report post

Every single day people ask us how to speed up their sites. So here are the most common reasons why a site can be slow and some solutions.

 

Shared Hosting

 

Shared hosting speeds depend on many factors.

 

  • How many other people are you sharing with?
    Often this is the main contributing factor and using the this tool you can instantly see how many other sites are competing for the resources.
     
  • Networked files systems.
    Often shared hosts will use networked filesystems to get more and more customers onto their overloaded servers.
    This is great unless you have many small files to load ( think file based object/db cache ) and the webserver has to fetch every single one
    over the network!
     
  • Poorly configured.
    Sometimes hosts disable a lot of core PHP functionality to make it more secure.
    SuHosin if not configured properly can cause problems.
     

One of the worse things for slowing down the web server is the amount of HTTP requests on a page. Back in the old days it would be one html file and a few images, so maybe 5 requests per page. Things have changed dramatically now! Ive tested some sites reported slow on this forum and seen well over 100 HTTP requests on one page alone! Imagine there are 1000 other sites on that server all with 100 requests per page! Now do you see why shared hosting is kinda slow sometimes?

​So there are a couple of ways to squeeze some more speed out of that 2 bit outfit you are paying next to nothing a month for.

 

  1. Caching.
    Im going to stick my neck out here and recommend wp-super-cache. Its been around for ages and just works!
    It will store your pages/posts etc as static files and serve them via .htaccess so PHP is not even loaded.
    Also has built in support for CDN Pull Zone.
     
  2. CDN.
    A Content Distribution Network offloads all your small files ( css/js/images ) to many other servers around the world and they are served
    by the closest server to the end user thats viewing your page, this speeds up your page response time by a huge amount!
    ​Remember all those HTTP requests  I mentioned just now?
    There are a few CDN plugins about none of which I have the time to test so I wrote one myself, its attached to this post. I adds a menu to
    the PageLines admin area with a text area to add your pullzone.
    If you need a cheap CDN package I recommend MaxCDN. 
     

Resources mentioned in this post.

 

WordPress Super Cache

 

Reverse IP lookup tool

 

MaxCDN

6 people like this

Share this post


Link to post
Share on other sites

17 answers to this question

  • 0

Posted · Report post

I want to back up Danny on what he said above and add a few things.

Get a VPS (Virtual Private Server)... there are tons of options, but Hostgator offers them, starting at $19/mo.  That's cheap!  Yeah, shared hosting might only cost you $5-$9, but come on... 

Caching
Use W3tc (W3 Total Cache)... I use it all the time and just last night I took a client's site that was loading around 9000ms with a page size of 860kb and 55 requests down to 1250ms on the load time.  Then added a CDN and he was getting around 0850ms on load times.  I can consistently get sites under 1 second load times with W3tc.  Also remember, if you have additional folders/subdomains that are not on WP, set caching in your .htaccess file.

In using a CDN, I prefer Rackspace.
 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Just wanted to add that Pagelines doesn't work great with Site5 shared hosting. Everything works great up until you get to the Pagelines setup stuff (page options, drag & drop, etc), nothing loads.

Here's to wasting a few days transferring and checking the sites. I wouldn't mind if Platform pro worked bad on Site5 too, but it worked great! Annoying.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Perhaps you should open a support topic.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I also use W3 Total Cache and recommend it. We are also using MaxCDN at the moment, which seems to be recommended everywhere.

 

Some useful websites for testing and improving your website's speed:

Google Pagespeed: https://developers.google.com/speed/pagespeed/insights

Pingdom Tools: http://tools.pingdom.com/fpt/

YSlow: http://developer.yahoo.com/yslow/

WebPageTest: http://www.webpagetest.org

 

I have a question for the experts. I successfully set up MaxCDN and W3 Total Cache for our blog, but Pingdom Tools still reports that files are not loaded from a cookieless domain. How do I make this happen?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@MarkManson - Please create a new topic.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I want to back up Danny on what he said above and add a few things.

Get a VPS (Virtual Private Server)... there are tons of options, but Hostgator offers them, starting at $19/mo.  That's cheap!  Yeah, shared hosting might only cost you $5-$9, but come on... 

Caching
Use W3tc (W3 Total Cache)... I use it all the time and just last night I took a client's site that was loading around 9000ms with a page size of 860kb and 55 requests down to 1250ms on the load time.  Then added a CDN and he was getting around 0850ms on load times.  I can consistently get sites under 1 second load times with W3tc.  Also remember, if you have additional folders/subdomains that are not on WP, set caching in your .htaccess file.

In using a CDN, I prefer Rackspace.
 

hey! I have ALL this except I haven't messed with a CDN because I'm nervous. but people STILL complain about my page speed. I have my own VPS/dedicated server. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Brighton,

 

I've just replied to you in another topic you opened on this subject.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Some other tips not mentioned above:

 

  1. Optimize your images for the web before uploading them + install smush it.
  2. Often plugins load their js and css files on all pages! Instead of only on those where they are needed. This can dramatically slow down your site completely unnecessary. Contact the developer to change this and in the meantime dequeue them on all other pages or at least on the most important pages, e.g. your homepage. See http://www.position-relative.com/2010/wordpress/wordpress-only-load-plugins-on-pages-that-need-them/ and http://www.position-relative.com/2010/wordpress/wordpress-only-load-css-stylesheets-on-pages-that-need-them/ on how to do this.
  3. Together with the CDN, use CNAMES to load your content from different domains.
  4. With W3TC you can also setup a CDN.

Cheers. 

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for the input JBrouwer!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

What about mysql database optimizations? My host (bluehost) reports that the database shows slow queries, and suggests adding indexes. I've searched around and the explanations are not clear to me, probably because I'm not experienced in tweaking the database.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Personally, I'd advise against using tools to optimize the database as this could literally wipe out your site if one little thing goes wrong.  It could also cause breaks in links, code, etc.

 

WordPress is designed to deal properly with your database and millions of websites have exceptional speed with massive databases, including my own, with over 40,000 posts and pages and nearly 110,000 images.  I'd recommend using MaxCDN to optimize the speed by offloading javasccript, images and other code to minimize the page load time.  Also, make sure your images aren't too big. Lastly, always make sure your plugins are up to date and are compatible with the latest version of WordPress.  Deprecated or outdated plugins probably will do more damage to speed than anything else.  Having too many plugins doesn't help either, so my rule of thumb is, if you don't need it, delete it. 

 

Hope this helps everyone.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hey, thanks for all these suggestions, they've definitely helped with my page loading speed.  I will say that the slowest file my site processes according to almost all the speed tests I've done is the CSS compile from pagelines.  Not sure where the right place to post this is, but I'm just wondering what the thinking is going forward on how to optimize the compile better and reduce the size of the page load.  I'm not leaving pagelines any time soon but I think moving forward this is one of the biggest challenges for PL.  

 

My sites are hosted by MediaTemple (on a Dedicated Server) running MaxCDN with W3 Total Cache & CloudFlare.  My pageload time averages around 6s to 7s with the CSS compile taking up about 3.5s or longer.  

 

Thanks for all the great work your team is doing.

 

James.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hey All.  I just wanted to follow up on my last post and say that I switched from W3 to Super Cache and the speed difference is incredible!  Super Cache loaded way faster, was easier to understand and set up and works well.  Speed Test on GTMetrix jumped from a C to an A.  Go figure.

 

James.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for letting us know.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

For anyone experiencing issues with the CSS/LESS compiler not firing completely on their shared hosting environment due to a lack of memory, here's what I did:

  1. If you try to crank up the RAM through wp-config.php and it doesn't make a difference, then it's unlikely that the server will ever have enough memory to properly compile all of the CSS/LESS files.
  2. Most likely, if you're a bit of a developer, you probably have a "local" version of the site on your own computer.
  3. Open up the Pagelines generated css file on the local version and copy that rather long line of css
  4. Paste into the style.css file of the child theme of your online site and save

This will have all of the compiled css rendered/minimized for you and put into style.css which means that your site will still look the same. The site will still attempt to load the Pagelines file, but that extra server "hit" will be solved with a caching plugin mentioned previously in this post.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for the updated information 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Here is what I use
 
WP Super Cache because it has a nice and simple user interface for setup and is the simple to install. Also it have integration with CDN which is a great plus. If you only want CDN integration i can recommend OSSDL CDN Off Linker.
 
A little helpful plugin is WP-Optimize which helps you to keep your database clean by removing post revisions and spam. Additionally it allows you to optimise your wordpress database (use with caution – I can recommend you do regular database backups so you can alway revert back if any thing goes wrong).
 
Another useful plugin is Quick Page/Post Redirect DEV to Redirect Pages, Posts or Custom Post Types to other locations.
 
Last I should mention Broken Link Checker, which checks your blog for broken links and missing images and notifies you on the dashboard if any are found. It’s great to keep track of the many outgoing links and keeping them up to date.
 
DV hosting from MediaTemple 
 
Content Delivery System – CDN
 
Read more about my WordPress setup for a photography blog.
1 person likes this

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