Frederic Crozat wrote:
> On Fri, 04 Jul 2003 15:24:37 +0200, Guillaume Rousse wrote:
> > I've never understood why so many people included a final / when citing
an
> > URL. Could you explain why ?
>
> Because it is the correct way to form an URL :

Well, both ways are the correct way to form a URI. However...

> Many web servers do a redirection when first case doesn't apply and
> 'bar' directory exist.. But it is BAD :)

...this is correct. But why is it "BAD"?

To be pedantic, the answer is that it's more "polite" to add the terminating
slash on URIs when you know that the final object is a directory. Otherwise,
the server has 1) opened the connection 2) done a file-exists test 3)
returned a redirect 4) accepted the resulting new connection from the
browser.

It is the last bit that proves the most expensive, as it's a whole new HTTP
connection. Plus the wasted overhead spent on the first request is
disproportionate for the result, especially if the second request results in
a 404.

Most of the time, though, this is something that a person worries about when
writing links for within his own site. But since it's "good form", people
have gotten used to seeing directory resource requests terminated with a
slash and it's become the Web equivalent of ensuring a sentence is
terminated with a period.

- John


Reply via email to