General slowness caused by excessive includes

  • Applies to: All Service Types
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: None


  • Web page loads slowly.
  • Elements of the page don't load.
  • The page seems to "hang" before loading a certain element, and then loads quickly.


This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the general scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.

Otto Can Help!

If you have a DV server and you're having trouble with the steps described in this article, additional assistance is available through our OttoTune service. Our expert engineers can tweak and tune your server for optimum performance. For more information on what Otto can do for you, please visit this article.


There can be many causes of slow loading times for a website. This article covers slowness caused by having too many elements in a specific page - particularly javascript includes.

First, we want to see if this issue may be affecting you. Two of the best tools available for analyzing the load times of individual elements on a web page are as follows:

How to use Pingdom and Firebug


  1. To use Pingdom, simply click on the link.
  2. Enter the exact URL for the web page you want to test, and click Test Now.
  3. You will see a graph of how long each element took to load, the name of the element, and its size.


Firebug and YSlow

  1. To use Firebug, you will need to visit the Firebug website to download the Firefox extension. Get YSlow while you're at it (you may have to install Firebug first).
  2. Once you've installed the plugin and restarted your browser, you will have two icons in the lower right of your browser:


  3. Visit your web page.
  4. Click on the bug icon. A tool will pop up on the lower half of your web page.
  5. Click on the Net tab, then on the dropdown next to it. Make sure Enabled is selected.


  6. Now hold down Shift and refresh your browser to see all the elements load again. You will get output like this:


    This shows the load time for each element on your web page. It will also show whether it loaded successfully or not. Missing items will show up in red.

  7. To use YSlow, either click the YSlow tab in Firebug, or click on the speedometer icon in your Firefox status bar.
  8. Click Run Test.
  9. Read the output, paying particular attention to elements with bad grades.



Both of these tools show the number of elements and relative loading time of each item very well. However, they may or may not reflect a true loading time for your page. Both tools tend to overestimate the time for each element. Pingdom, particularly, since it requires a remote server to load the page, can add several seconds more to the page load time than most people are experiencing.

Common culprits

So, now you've run a couple of tests and identified some slow items. The four most common page elements that cause long load times are as follows:

  1. Large files, such as videos and images.
  2. Elements that require a lot of MySQL queries before they're generated. See MySQL optimization for further assistance.
  3. Elements included from other servers, particularly javascript elements.
  4. Plugins for your software that use the above type of content - plugins for popular software can be written poorly, because the coding experience of plugin developers varies greatly.

For videos and images, you should look into using a more compressed version of the file, or using a thumbnail on the main page (but NOT an on-the-fly resized copy of the large image - this actually requires more server time than just showing the large image).

For help with MySQL, see the links in Item 2 above. Note that if the MySQL queries have to be loaded before the main page can even display, they may show up as "hidden" load time in the main page (the first element shown in Pingdom and Firebug).

Now, let's take a further look at included files.

Many web pages contain references to elements that are not actually hosted on that server. Each external request requires a number of extra elements to be loaded through your server and your browser, which can add significantly to your page load time.

For example, your web page might use javascript to create menu effects. This script is actively maintained by its creators, and new features are added regularly. To make sure you always have the latest version for your website, you've include the script on your page like this:

Filename: example.php

<script type="text/javascript" src=""></script>

This requires a call to the host for that script whenever your page loads. Even worse, what happens if that host is slow at some point, or even unavailable? Browsers will wait for an extended period to try to include that script. The end result is that your web page is extra slow, and some page elements may not load properly. The more elements you have like this - images, PHP, Twitter feeds - the more your page slows down.

The solution for this is to download a copy of all your external content (or as much as you can), and upload it to the server here. When a new version comes out, just replace the version that you have on your own server, rather than querying a third-party server every time your page loads.

Finally, regarding plugins - if you're savvy enough to tweak your inefficient plugin, go right ahead. If not, look for updates, patches, or similar plugins that have better reviews for efficiency and speed.

Additional resources

What if this doesn't solve my problem?

If you've determined that you do not have an excess of elements included in your web page, you may want to check out our website slowness article for further suggestions.