HojjatK
HojjatK

Reputation: 2128

How to define a caching rule in Azure CDN for the root path without rewriting the url?

I have a static website in azure that hosts an angular webapp, and I have setup a CDN with Standard Verizon pricing tier.

The problem is whenever I deploy a new version, users need to clear their browser cache to see the fresh content and it is annoying.

I would like to do not cache the index.html content which is the response of root path. However, Azure does not let me to define a rule so that root path response should not be cached.

If you know how to achieve, it would be great.

Thank you

enter image description here

Upvotes: 2

Views: 816

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28294

I would like to do not cache the index.html content which is the response of root path. However, Azure does not let me to define a rule so that root path response should not be cached.

If you do not want the root path cache, you could use the global rule instead for a custom rule that applies to all requests. For example, you could set the global cache behavior Bypass cache. Then you could set the individual custom rules for other contents required caches. Custom caching rules take precedence over global caching rules, where they apply. If a request matches both conditions, rules at the bottom of the list take precedence over rules at the top of the list. Refer to this1 and this2.

Hope this could help you.

Upvotes: 2

Related Questions