Setting a Query String - ignore or accept
The Query String option of both CDN Static and CDN Static Push services gives you a control over the cache system on our CDN servers. The Query String option determines whether we should cache your URLs
- http://cdn.mycompany.com/photo.jpeg and
under the same cache key (Query String Ignore) or not (Query String Accept). Whether we should take those URLs as identical (Query String Ignore) and return the same content or not (Query String Accept) and cache the corresponding responses from your Origin Domain/Storage under two different cache keys. We recommend to set Query String to Ignore to increase your cache hit ratio and improve the performance.
Please see also Setting a Set-Cookie - ignore or accept.
Let's assume that your application is adding a query string to all your URLs automatically and that every logged user has its own unique query string. Moreover let's assume that you have 1000 users and that you deliver your CSS file through CDN.
- Query String Ignore - your CSS file is cached in the CDN cache under 1 cache key and this copy is served to all your logged users.
- Query String Accept - your CSS file is cached in the CDN cache under 1000 cache keys and these copies are served to your logged users in one-to-one correspondence to their unique query strings.
Note that in most cases you don't want to cache your CSS file under 1000 cache keys because in that case for every cache key the CSS file has to be pulled from origin first and it negatively impacts your cache hit ratio and the performance. We recommend to set Query String to Ignore to increase your cache hit ratio and improve the performance.
Let's assume that you are using Static CDN for your CSS file so your CSS file is cached at our CDN servers.
Let's assume that you update your CSS file.
You purge the CSS file from the CDN cache to pull (upload) the new version.
The problem is that your end users may still be seeing your old CSS because there are always two caches - the CDN cache and the browser cache.
Now if you have the Query String option set to ignore you can modify your HTML in this way.
<link href="/htdocs/css/style.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/htdocs/css/style.css?v2" media="screen" rel="stylesheet" type="text/css" />
In this way you force the browser to download the new version of your CSS file from the CDN cache.
As you have the Query String option set to ignore you have exactly one copy of your CSS file in the CDN cache, in other words you don't cache both the old version and the new version of your CSS file.