Summing up all the discussions in the comments and without changing my initial sentence, here is what I finally come up with:
You want to access images through tags; each tag refers to a set of images. Since this tag can be used much more than the other (for example, photos in New York are used much more than in Chicago), you should use the RESTful configuration, which allows you to cache, so you can cache photos in New York. IMHO, the solution will be:
Each image has a fixed URI:
http:
Each tag also has a URI:
http://www.example.com/tags/New_York/random
This URI acts as a random image manager on the set; it returns 303 See another answer , redirecting to a random set image. By definition , this URI cannot be cached, but a fixed one should, and the browser should not understand that the redirection to the second resource is permanent, so it is optimal.
You can access the entire set through:
http:
This access will result in a 300 Multiple Choices response; it returns the entire set (as a URI, not as an image!) to the browser, and the browser decides what to do with it.
You can also use the intersection of various tags:
http://www.example.com/tags/New_York/Autumn/Manhattan/random http://www.example.com/tags/Autumn/Manhattan/New_York/random (equivalent to the previous one) http://www.example.com/tags/New_York/girls/Summer/random etc.
So you have a fixed URI for each image, a fixed URI for each tag, and a set of photos associated with it, and a fixed URI for the random dispatcher that each tag has. You do not need to use any GET parameters as other potential solutions, therefore it is as RESTful as you can get.
AticusFinch Dec 31 '09 at 14:11 2008-12-31 14:11
source share