Why you need a CDN
Using a CDN is one of the easiest and fastest ways to boost your website performance.
In order to see where the biggest peformance bootlenecks are, you can start by having a look at a waterfall graph of your website. The example above comes from b2evolution.net (before optimization). Any modern web browser will let you display this for you own site by using its developer menu/tools. When you do this for your site, just remember to clear your browser cache before measuring, otherwise your results won’t really show what your visitors experience.
The waterfall graph shows one line for each file that is downloaded to display your page. Here are the color codes used by Safari:
- The blue line is the main PHP/HTML file;
- The green lines are for CSS files;
- Finally the purple ones are for images.
Pay attention to 3 important aspects here:
- There are usually more files than you think that need to be downloaded to display a single web page.
- All files don’t start downloading right away.
- Each file has a long Latency time and a comparatively short Actual Transfer time.
Let’s look at these 3 problems in order.