I've come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding.
There are several old posts that discuss and describe these things:
- I've summarised what I think is important:
- urls with query params won't have their response cached by intermediaries/proxies (at present)
- matrix parameters may appear anywhere in path
- calculating the relative uri is different
- much more than uri convention
- query params are generally abused to add new verbs instead of using existing methods on resources
- matrix parameters are not resources, they are aspects that help reference a resource in an information space that is difficult to represent within a hierarchy
Tip: If you're not sure if you should use them then don't.
- Matrix parameters are used with
- YUI paging widgets
- RoR /some/resource/id;edit
- J2ee fallsback to ;jsessionid=xxx when no cookies can be set.
- Jersey (JAX-RS RefImpl) has good support
Caching Issues
- Intermediaries (proxies) won't cache any url with a query parameter in the url
- this is because in the early days of the web, they didn't trust the Cache control information from dynamically generated pages.
- Freshness and Validation information are very important pieces of information and the proxy admins took a cautious stance and didn't cache any of it.
As the web has matured the views of devs/admins are changing, the new versions of Squid will default to cache any urls with query parameters
Obviously this could have a very large impact, I've heard google maps image tiles had this issue with some proxies at one time.
Relative URI calculations
Relative URIs have different affects, as relatives URLs are determined by appending to the Base URI. For Query Parameter requests they are stripped from the Base.
For those still interested I would recommend checking out the following in addition to the RFC-2616 of course.
good stuff! thanks for putting all of this info together.
Hey, thanks for the shoutout.
Hi Brett, the content for this post seems to have disappeared. I would be very grateful if I could see a copy. We’re having a discussion on my firm on query parameters vs. matrix parameters in RESTful service URIs. Thanks!
site5 moved hosts recently.
here is a dump of the raw content in the mean time.
I’ve come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding.
There are several old posts that discuss and describe these things:
* `Query Strings Considered Harmful `_
* `w3c MatrixURIs `_
I’ve summarised what I think is important:
– urls with query params `won’t have their response cached by intermediaries/proxies (at present)`_
– matrix parameters may appear anywhere in path
– `calculating the relative uri`_ is different
– much more than uri convention
– query params are generally abused to add new verbs instead of using existing methods on resources
– matrix parameters are not resources, they are aspects that help reference a resource in an information space that is difficult to represent within a hierarchy
**Tip: If you’re not sure if you should use them then don’t.**
Matrix parameters are used with
* `YUI paging widgets `_
* `RoR`_ /some/resource/id;edit
* J2ee fallsback to ;jsessionid=xxx when no cookies can be set.
* `Jersey (JAX-RS RefImpl) has good support `_
.. _RoR: http://rails.org
.. _won’t have their response cached by intermediaries/proxies (at present):
Caching Issues
~~~~~~~~~~~~~~~
Intermediaries (proxies) won’t cache any url with a query parameter in the url
* this is because in the early days of the web, they didn’t trust the Cache control information from dynamically generated pages.
* Freshness and Validation information are very important pieces of information and the proxy admins took a cautious stance and didn’t cache any of it.
As the web has matured the views of devs/admins are changing, the new versions of Squid will default to cache any urls with query parameters
Obviously this could have a very large impact, I’ve heard google maps image tiles had this issue with some proxies at one time.
.. _calculating the relative uri:
Relative URI calculations
~~~~~~~~~~~~~~~~~~~~~~~~~
Relative URIs have different affects, as relatives URLs are determined by appending to the Base URI. For Query Parameter requests they are stripped from the Base.
For those still interested I would recommend checking out the following in addition to the `RFC-2616 `_ of course.
* `the matrix revisited `_
* `PathsAndQueryStrings `_
* `http url path parameter syntax `_
* `Building URIs `_
Thanks, Brett!
cool man …a new piece of information