I am developing a media server, the basic functionality is to serve an image, which is done the following way
/media/:id
where :id is the id of the image.
You may want to ask for a specific size, with some rules I will provide.
Eg:
/media/:id/50x50
/media/:id?witdh=50&height=50
Question: Which option do you think is better? I believe the second one to be more RESTful and beautiful, but we will be using a CDN and varnish for cache, so if we get
/media/:id?width=50&height=50
or
/media/:id?height=50&width=50
we will have 2 hits when we should have 1
Any advice?
?height=49&width=51
would also be valid. The50x50
path segment doesn't give this suggestion. How free are your users in choosing image size? – Bart van Ingen Schenau Jul 16 '14 at 15:55