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.

Advanced Support can help!

If you're having trouble with the steps in this article, additional assistance is available via Advanced Support, our premium services division. Our expert engineers can tweak and tune your server for optimal performance. For more information on what Advanced Support can do for you, please click here.


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


  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.



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

Was this article helpful?
0 out of 1 found this helpful