Tuesday, 1 October 2013

Cache-control: Is it possible to ignore query parameters when validating the cache?

Cache-control: Is it possible to ignore query parameters when validating
the cache?

Is it possible to set a cache-control header communicating with a reverse
proxy to ignore query parameters in a unique uri or basically: validate a
cache even if some query parameters have changed?
Sometimes query parameters have nothing to do with the rendering of the
page at least from a server side perspective. For instance all utm_*
variables from Google Adwords. These are needed for the javascript on your
page so you don't want to strip them away and redirect to a cached page
but at the same time it would be advantageous not to treat two uri's which
are basically the same but have different utm_* parameters as unique when
communicating with a reverse proxy.
An example:
http://www.example.com/search?sort=price
http://www.example.com/search?sort=price&utm_campaign=shoes
Is there anyway to tell the reverse proxy using the HTTP 1.1 (i.e. some
type of http header) spec that it can just treat these two pages as the
same?

No comments:

Post a Comment