ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Site is slow- how do I know what is causing that?

August 13, 2012 8:37pm

Subscribe [3]
  • #1 / Aug 13, 2012 8:37pm

    Abbas Jaffar Ali

    29 posts

    I have a site that is almost ready for launch- one to two weeks but has become really slow. Rackspace is saying that there i no issue from the server side and say it has to do with the CMS/Plugins and sent me the following URL:

    http://www.webpagetest.org/result/120814_K4_7C/1/details/

    How can I determine that is causing the slowness? Is it any particular plugin?

  • #2 / Aug 14, 2012 6:58am

    John St-Amand

    865 posts

    One quick way you can help analyze your site setup is to turn on template debugging and the output profiler (located under admin > system admin > output and debugging).  If you turn on output profiler and template debugging, the next time you load up a page view in your site while logged in as system admin, those details will display below.  If will show a long itemized list of all the things being run through EE as the page loads, including the time it takes to load each element and the memory allocated for that process.  That MAY help you pinpoint if there are specific processes contributing disproportionately to the page speed.

    The other thing you can do is use the browser plugin called Y-Slow to run an analysis of your site.  It will point out things that could be improved generally about the site’s performance (same idea as what Rackspace sent you, but perhaps a little more readable).  I did that for your main page for example, and there are a few things that are independent of the CMS that you could streamline to make the site run faster.  As an example, the analysis showed 18 external JS files loading for the main page.  And they’re all loading in the header.  So three things could help there:

    1) If not all of those javascripts are needed for the main page and you’re simply loading them all every time as part of a shared header template, you could use conditionals in EE to only load those that are needed (i.e. detect when you are on the home page, for example, and load only those javascripts that are needed for the home page).

    2) Combine and minify the JS files.  Add-ons like minimee are great for this.

    3) Move JS to the footer of the site rather than load it in the header.  When JS files are loaded in the header, they have to finish loading before the rest of the page loads.  That can give the impression of a slow site.  Move the JS to the footer, and the HTML body of the page loads earlier, which gives a faster impression of the site.  There are pros and cons from your analytics perspective, depending on whether you are interested in having complete page views counted or whether partial; page views are counted as views. But generally, I’m a fan of moving most JS to the footer for the visitor’s sake.

    And JS is only one aspect of the site that Y-Slow or other similar site analysis systems will point out.  Anyway, hopefully that gives you something to go on.

    Cheers.

  • #3 / Aug 14, 2012 9:58am

    Enviromed

    375 posts

    Great write-up from John, as usual.  The solspace.com template morsels and static page caching addons are very effective.

  • #4 / Aug 14, 2012 10:06am

    John St-Amand

    865 posts

    Good thing to raise, Enviromed. Yes, Abbas Jaffar Ali, if you’re looking to get into more advanced ways to have your site run faster, you could look at caching systems, such as Solspace’s Template Morsels, Causing Effect’s CE Cache and Croxton’s Stash.  But generally, speaking, before you look at caching, optimizing your templates should be done first since you’ll realize significant performance gains from that process, which then carry into the caching options, should you implement them.  Even EE’s native template and entries caching can make a big difference to page load speed when used effectively.

    Other common ways to improve performance include minimizing the number of embeds you use (if any), minimizing, eliminating or even cheating advanced conditionals (see Switchee and Ifelse from Croxton for the latter, or take a look at Low’s excellent post about using preload replace variables to use EE parse order to your advantage in parsing conditionals).

    There’s no single thing for you to do to solve everything, but if you go through your templates with a clear head and a focus on optimization, you’re bound to find ways to simplify and improve performance.

    Cheers.

  • #5 / Aug 14, 2012 4:40pm

    Abbas Jaffar Ali

    29 posts

    Thanks very much for your response John- will definitely look into your suggestions.

    Abbas

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases