Home About Blog

Querystrings and impact on cache performance

Unique query string on HTML document URLs can result in a lot of cache misses and cause a large amount of traffic to the webserver. Depending on the nature of the query strings you can mitigate a lot of this traffic.

A lot of query strings are used only on browser side for 3rd party tracking scripts. Typical examples are gclid, utm, etc. Any browser side tracking querystrings can be stripped before sending the request to be looked up in the cache. This will increase cache hit rate for HTML and reduce traffic to the origin.

Here is a Gist example where we are removing several common query strings.