Common reasons for poor website performance

 
 

Overview

This article offers a few tips on how to improve your website performance and diagnose why it may not be running as efficiently as possible.

This optimization article applies to websites that were custom-built using HTML/CSS/JS and any other backend language such as PHP.

See these articles instead if you built your site using the DreamHost WordPress installer.

Optimizing CSS and JavaScript

Minify your scripts

CSS and JavaScript files have lots of empty space which makes them easier for humans to read. When you minify the code, it strips out all of that empty space. This makes the file smaller and can help them to load faster.

A quick online search will list many websites and tools available to minify your code.

CSS

Optimize CSS delivery

CSS can be optimized to improve the initial page load. See the following article for further details:

JavaScript

Use a CDN to load jQuery

If your site is using jQuery, load it into your HTML document using a CDN as opposed to a local version on your web server. Loading jQuery from a CDN such as Google can help to speed up page load. This is because your visitors most likely have already visited several sites that are using a jQuery CDN (like Google or Microsoft). Because they have already downloaded the jQuery library to their browser, it is already cached and will not need to be downloaded again. The following pages list options jQuery CDN options:

Optimize JavaScript delivery

JavaScript is rendered as the browser reads the webpage (top-down). When a JavaScript file is encountered, the browser stops rendering the page until the JavaScript file has been fully read. This is called 'JavaScript Render-Blocking' and could cause a delay as the page loads.

If a script is not needed to load the page, defer the loading of it until the page has fully loaded. This can help the most important parts of the page to load first. View the following articles for further information:

Check for poorly written scripts

Sometimes, a poorly-written script or a script that conflicts with other site elements can lead to a slow site and poor performance. Try running a full-page test at any of the following sites:

Scripts that take a long time to load should be investigated to see if they can be better optimized. It may also help to disable a script to test if deactivating it improves performance.

Optimizing Media

Images

Images are often a primary source of slowness. Having a megabyte or more of images will significantly slow down your site because it takes longer to download all of the site files. Optimizing your images helps to reduce your page load time.

See the following page for further information:

Video

Make sure you compress your videos to reduce the total size. If they are too large, the videos may pause/buffer as the user attempts to view them.

It's also a good idea to convert your videos to a format compatible with HTML5. This ensures the greatest number of browsers are able to view them.

Caching

A Cache is a temporary storage area for different types of computerized data. For example, browser caching allows webpage files like images, CSS, and JavaScript to be cached (stored) in the browser. Since those files are already stored, the next time you visit the same website your browser does not need to download them again, resulting in a faster browsing experience.

There are many different types of caching options for websites. Below are just a few common examples:

Content Delivery Network (CDN)

You can use a CDN to deliver static files such as images, video, CSS, and JavaScript files, which can help speed up delivery to the end user.

Web server and database

Web server

It's also possible that there could be a problem with the DreamHost web server your site is hosted on. See this article for command line (SSH) examples you can use to troubleshoot your server.

PHP

OPcache is a caching engine built into PHP that helps improve website speed automatically.

Also, make sure to test all PHP scripts. PHP scripts that do not properly end can cause processes to be skipped for hitting the FCGI process limit, which can cause site slowness.

Databases

Your MySQL database might run slowly if it has excessive "overhead" (unused empty space). This can cause queries to the database to take longer and may result in the web server timing out before it can receive the response from the database server.

See this article for detailed instructions on how to optimize your database using phpMyAdmin or SSH.

Network troubleshooting

Traceroute

The Traceroute tool is often used for network troubleshooting. By displaying the network path traversed from one computer to an end destination, it can help identify routers that are obstructed or causing a delay.

Internet Service Provider (ISP)

Check with your ISP to see if they are currently having connectivity issues or blocking your traffic in any way. Examples include network congestion, bandwidth throttling, and even content filtering.

Network tools

Test your local Internet speed at a site such as speedtest.net. This may help to confirm if your local connection is having connectivity problems.

Other options include network and site loading tools to check different parts of a network.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?