We have been using incorrect URLs all this time

I learned a couple of days ago that I was typing in web addresses (URLs) incorrectly. It turns out that there should be a slash (/) at the end of the URL that you enter. When you omit this slash your browser and the server work out the problem – but it takes some time.

This is explained in detail in this article. Here is an example of what is happening:

  1. You ask the server for: http://alistairpott.com
  2. The server says that page doesn’t exist – you mean (note the slash): http://alistairpott.com/
  3. Your browsers says OK and then asks for http://alistairpott.com/
  4. The server sends back the page

It’s not quite this simple (this only applies when you are not referencing a file directly), but the principle is there. You can often see this is happening – go to a site and you will see that once the page is loaded there is a trailing slash in the URL.

Entering the correct address (with a slash) prevents the first 2 steps and can speed things up. How much of a speed up? Probably not much.