Jump to content


Photo
* * * * * 1 votes

The quest for speed.

cache speed css js

  • Please log in to reply
17 replies to this topic

#1 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 15 February 2013 - 09:02 PM

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

    Please Login or Register to see this Hidden Content

    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 

    Please Login or Register to see this Hidden Content

    . 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.

 

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

 

MaxCDN

 

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content

  4.09KB   48 downloads


  • Danny, Jenny, mikezielonka and 2 others like this

#2 tsalstrand

tsalstrand

    Super Member

  • Members

  • 225 posts
  • Framework Version:latest
  • Country: Country Flag

Posted 22 February 2013 - 04:06 PM

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.
 



#3 Nick II

Nick II

    Newbie

  • Members
  • 8 posts
  • Framework Version:2.3.2

Posted 23 February 2013 - 12:59 PM

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.



#4 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 23 February 2013 - 01:03 PM

Perhaps you should open a support topic.



#5 markmanson

markmanson

    Newbie

  • Members
  • 3 posts
  • Country: Country Flag

Posted 24 February 2013 - 07:30 PM

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:

Please Login or Register to see this Hidden Content

Pingdom Tools:

Please Login or Register to see this Hidden Content

YSlow:

Please Login or Register to see this Hidden Content

WebPageTest:

Please Login or Register to see this Hidden Content

 

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?



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 13148 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 25 February 2013 - 08:34 AM

@MarkManson - Please create a new topic.



#7 brightonkeller

brightonkeller

    Super Member

  • Members

  • 128 posts
  • LocationNew Orleans
  • Country: Country Flag

Posted 03 March 2013 - 08:31 PM

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. 



#8 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 03 March 2013 - 08:45 PM

Brighton,

 

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



#9 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts
  • Country: Country Flag

Posted 08 March 2013 - 10:35 AM

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 

    Please Login or Register to see this Hidden Content

    and 

    Please Login or Register to see this Hidden Content

    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. 


  • Danny likes this

#10 Danny

Danny

    Is Awesome!

  • Moderators
  • 13148 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 08 March 2013 - 11:44 AM

Thanks for the input JBrouwer!



#11 lakersalex

lakersalex

    Super Member

  • Members
  • 102 posts
  • LocationLos Angeles
  • Country: Country Flag

Posted 15 March 2013 - 01:16 AM

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.



#12 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 16 March 2013 - 03:06 PM

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.


  • Blackice likes this

#13 James Giroux

James Giroux

    Super Member

  • Members

  • 123 posts
  • LocationOttawa, Canada
  • Framework Version:Developer
  • Country: Country Flag

Posted 13 April 2013 - 02:47 AM

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.



#14 James Giroux

James Giroux

    Super Member

  • Members

  • 123 posts
  • LocationOttawa, Canada
  • Framework Version:Developer
  • Country: Country Flag

Posted 13 April 2013 - 03:23 AM

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.



#15 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 13 April 2013 - 01:18 PM

Thanks for letting us know.



#16 dokether

dokether

    Advanced Member

  • Members


  • 30 posts
  • LocationEdmonton, AB
  • Framework Version:2.4.2
  • Country: Country Flag

Posted 17 May 2013 - 04:39 PM

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.


  • Blackice likes this

#17 Martin Davies

Martin Davies

    Advocate

  • Moderators
  • 2497 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 17 May 2013 - 04:42 PM

Thanks for the updated information 



#18 Martin Bay

Martin Bay

    Super Member

  • Members
  • 128 posts
  • LocationDenmark
  • Framework Version:Latest :)
  • Country: Country Flag

Posted 31 July 2013 - 07:37 AM

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

Please Login or Register to see this Hidden Content

 for a photography blog.

  • batman likes this





Also tagged with one or more of these keywords: cache, speed, css, js