Search code examples
azureazure-cdn

Azure cdn Ignore query strings purpose


I know what is the difference between Azure CDN query string modes and I have read a helpfull example of query string modes but...

I don't understand what is the purpose of "Ignore query strings" or how this can be useful in a real dynamic web.

For example, suppose we have a product purchase website with a URL similar to www.myweb.com/products?id=3

If we use "Ignore query strings"... Does this mean that if an user later requests product 4 (www.myweb.com/products?id=4), he will receive the page for product 3?

I think I'm not understanding correctly Azure CDN, I'm seeing Azure CDN as a dynamic content CDN, however Azure CDN is only used for static content as this article explains:

Standard content delivery network (CDN) capability includes the ability to cache files closer to end users to speed up delivery of static files.

This is correct? Any help or example on the subject is welcome


Solution

  • Now that I have it clearer, I will answer my question:

    Azure CDN - Used to cache static content, even on dynamic web pages.

    For the example in the question, all products must download the same javascript and css content, for those types of files Azure CDN is used. Real example using "Ignore query strings":

    • User A www.myweb.com/products?id=3, jquery-versionX.js and mystyles.css are not cached, the server is requested and the user receives it.

    • User B www.myweb.com/products?id=4, since we are using "Ignore query strings" the jquery-versionX.js and mystyles.css files are cached, they are served to the user without requesting it from the server again.

    • User C www.myweb.com/products?id=3, since we are using "Ignore query strings" the jquery-versionX.js and mystyles.css files are cached, they are served to the user without requesting it from the server again.

    Reddis or other similar - Used to cache dynamic content (queries to databases for example).

    For the example in the question, all the products have different information, which is obtained by doing a database query. We can store those queries or JSON objects in a Reddis cache. Real example:

    Summary:

    Both methods can be used simultaneously, Azure CDN is for static content and Reddis or similar for dynamic content.