URLQuiz #2: URL Equivalence and Cachability
Thursday, March 1st, 2007This is quiz #2 of our ongoing URLQuiz series.
In this quiz, there are 26 pairs of URLs (A..Z) and for each pair the questions is: “Which of these two URLs are equivlent?” i.e. which return the same resource when dereferenced, and “Which can be cached as the same URL?”
You should answer ‘Yes‘, ‘No‘, or ‘Maybe‘ where ‘Maybe‘ means ‘It might return the same resource but should not be cached according to the specs.’
To answer, leave a comment and ideally explain your reasoning for each. Feel free to group answers based on your reasoning and/or the answer given (Yes, No, and Maybe.) Print it out and take the quiz with pencil and paper if you serious about getting it right, and feel free to use a computer or browser or whatever to test your results before answering. Good luck!
About the TLD .foo[1]
Clarification (2007-March-02): Some people have stated that the server could possibly return the same resource for any two given URLs so they felt the answer could never be ‘No.’ I definitely see their point, for example http://mysite.foo/bar and http://mysite.foo/bazz could possibly return the same thing but nobody would ever reasonably expect them to do so on their on. So let me clarify to say that I meant a quiz taker to select ‘No‘ in the case where where the resource returned would definitely not be the same thing unless the developer or server admin explicity programmed or configured them to do so. On the other hand ‘Maybe‘ would be used in the case where someone might reasonably expect the two URLs to return the same resource even though the RFC 3986 would define the two URLs as being different such as in [footnote 2], or when it depends on the O/S of the server as in [footnote 3]. Regarding fragments, the question is “In a transaction between a client and a server, is the cache allowed to view them as the same?” Regarding which can be cached I was looking for what are appropriate per the spec, not necessarily whether any particular software in the cloud (i.e. routers, proxies, browsers, etc.) actually does cache but instead “Would it be allowed to cache?”
Questions
- The ‘www’ domain
- http://mysite.foo/
- http://www.mysite.foo/
- Letter casing in path
- http://mysite.foo/Index.htm
- http://mysite.foo/index.htm
- Letter casing in domain
- http://MySite.foo/index.htm
- http://mysite.foo/index.htm
- Index.htm vs. Default.aspx
- http://mysite.foo/Index.htm
- http://mysite.foo/Default.aspx
- Trailing slash on domain
- http://mysite.foo
- http://mysite.foo/
- Trailing slash on path
- http://mysite.foo/path
- http://mysite.foo/path/
- Empty question mark
- http://mysite.foo/
- http://mysite.foo/?
- Empty parameter
- http://mysite.foo/?
- http://mysite.foo/?param=
- Port 80
- http://mysite.foo/
- http://mysite.foo:80/
- Port 443
- http://mysite.foo/
- http://mysite.foo:443/
- Https vs. Port 443
- https://mysite.foo/
- http://mysite.foo:443/
- Ftp vs. Http
- ftp://mysite.foo/
- http://mysite.foo/
- Letter casing in parameter name
- http://mysite.foo/?param=bar
- http://mysite.foo/?Param=bar
- Letter casing in parameter value
- http://mysite.foo/?param=bar
- http://mysite.foo/?param=Bar
- Hash vs. no hash
- http://mysite.foo
- http://mysite.foo#
- Hash vs. Fragment
- http://mysite.foo#frag
- http://mysite.foo#
- Fragment vs. no Fragment
- http://mysite.foo#frag
- http://mysite.foo
- Plus vs. Space in path
- http://mysite.foo/url+design
- http://mysite.foo/url design
- Space vs. Encoded Space in path
- http://mysite.foo/url design
- http://mysite.foo/url%20design
- Plus vs. Encoded Plus in path
- http://mysite.foo/url+design
- http://mysite.foo/url%2Bdesign
- Slash vs. Encoded Slash in path
- http://mysite.foo/top/second
- http://mysite.foo/top%2Fsecond
- Ampersand vs. Encoded Ampersand in path
- http://mysite.foo/abc&xyz
- http://mysite.foo/abc%26xyz
- Ampersand vs. Encoded Ampersand in parameter value
- http://mysite.foo/?q=abc&xyz
- http://mysite.foo/?q=abc%26xyz
- Equals vs. Encoded Equals in path
- http://mysite.foo/abc=xyz/
- http://mysite.foo/abc%3Dyxz/
- Equals vs. Encoded Equals in parameter value
- http://mysite.foo/?q=abc=xyz
- http://mysite.foo/?q=abc%3Dyxz
- Parameter order
- http://mysite.foo/?abc=123&xyz=987
- http://mysite.foo/?xyz=987&abc=123
P.S. Don’t stress if you can’t answer them all. It took me months to uncover all these nuances, and if I were taking this quiz I doubt I could get them right all in one sitting.
FootNotes
- I’m using the non-existent top-level domain “.foo” to avoid giving any link-love to arbitrary example sites that don’t deserve it! For the purpose of the quiz, just assume that “.foo” is a functioning top level domain.
- Question A.
- Question B.