5 Common Causes of Slow Website Performance

1. Unoptimized Images

Sites impacted: 90%
Unoptimized images are images that can be reduced in size without visual impact to your user, also known as “lossless” optimization. Images that are optimized using lossless methods are visually identical to their original images, just stripped of extraneous metadata that helps describe the image (useful to the designer, not needed for the end user).
A few best practices to consider:
  • PNG image files are often needlessly large. This is due to extra data inside the PNG file such as comments or unused palette entries as well as the use of an inefficient DEFLATE compressor. PNG images can be optimized using free tools like pngcrush that reduce the size of the file without changing or reducing the image quality.
  • JPEG image files can also be needlessly large for similar reasons to PNG. By using free tools such as jpegtran you can convert JPEGs into progressively rendered JPEG files to reduce the size of the file without losing image quality.
  • PNG files are best used for icons and logos while JPEG is preferable for photos. Because PNG images support transparency while JPEGs do not, the PNG format is commonly overused for images that are better served as JPEGs. By utilizing JPEG instead, you often can realize file size savings as large as 80%. If possible, consider reworking your design to avoid the use of transparency. Alternatively, you can often append a smaller transparent PNG image alongside the larger JPEG image to achieve the same visual effect at substantial file size savings

2. Content Served Without HTTP Compression

Sites impacted: 72%
Enabling HTTP compression on your webserver can dramatically reduce the size of the downloaded page, significantly improving load time. This is a high impact change, but is not always as easy as it may seem.
For Apache 2.0 and above, load the mod_deflate module to enable compression.

3. Combinable CSS Images

Sites impacted: 69%
Browsers make an individual HTTP request for every background image specified in your CSS pages. It is not uncommon for over half of your total HTTP requests from a single web page to be used for loading background CSS images. By combining related images into a small number of CSS sprites, you can significantly reduce the number of HTTP requests made during your page load.

4. Images Without Caching Information

Sites impacted: 65%
HTTP Caching allows the browser to store a copy of an image for a period of time, preventing the browser from reloading the same image on subsequent page loads and thus dramatically increasing performance. To cache your images, update your webserver configuration to provide an Expires header to your image responses from the server. For images that do not change often, you should specify a “far future” Expires header, typically a date 6 months to a year out from the current date.
Note that even with a far future Expires date, you can always change the image later by modifying the referenced filename using versioning, for example MyImage.png becomes MyImage_v2.png.

5. Domain Sharding Not Implemented

Sites impacted: 64%
Most browsers typically support 2-4 concurrent downloads of static resources for each hostname. Therefore, if your page is loading many static resources from the same hostname, the browser will bottleneck in a stair-step fashion downloading all the content. By splitting resources across 2 different domains, you can effectively double browser throughput downloading the required links.
Note that it may be administratively difficult to physically move your files to different hostnames, so as a clever “trick” you can utilize DNS CNAME records to map different hostnames to the same origin. For example, static1.example.com and static2.example.com could both map to static.example.com, thus prompting the browser to load twice as many links concurrently as before, without requiring you physically move the files on the server.
Of course too much concurrency has its own drawbacks on performance, so testing should be done to find the optimal balance.

Source: http://zoompf.com/2013/04/top-5-causes

No comments:

Post a Comment