Fixing broken links is a tedious part of your website maintenance. We all know that fixing broken links is important. While a link within the text of your web page won't affect how fast the page itself loads, there are some links on your web pages that will affect the speed of your pages.
HTTP Requests are Slow
While the most common places you can have broken links on your website is in the content, there are other places that many web designers forget to check. In fact, I have been guilty of not checking these links myself, with sometimes disasstrous results. These links include:
- Image source files
- CSS links
Images are the most easily found broken links because most browsers show them as a broken image when the URL is wrong. But even broken images can be missed, especially images that are used for site design, spacers and so on. If the image size is defined (in CSS or the image itself) as extremely small, the broken image can be missed.
But when you have a 404 for an image, that causes a useless response from an HTTP request. And as I mention above, HTTP requests are slow. So if your page has to spend extra time requesting images that are not available, the time it takes to download is increased.
Another place to check for broken links is your CSS
LINK tags in the
HEAD of your document. Like images, if the CSS file is not where you've linked to, this sends a useless HTTP request to the server and returns a 404 code. It is especially common for sites that use a lot of external CSS files to have a typo in one of the URLs or have the file be moved causing the 404. On one site I worked on, one designer thought the styles she needed were not created yet, so she added them to her CSS file, when they were included in one of the other linked style sheets—with a typo in the URL that she never checked. We only found it by going through our 404 error reports.
Remember to Check Scripts, Images, and CSS When Verifying Broken Links