question

Rem-0323 avatar image
0 Votes"
Rem-0323 asked SaiKishor-MSFT answered

Microsoft Standard CDN, cache expires too soon causing frequent cache misses

I'm using the standard microsoft CDN in front of an Azure Storage Static website.

The origin doesn't respond with any cache headers (not supported by Static Website), but I have configured in my endpoint rules engine with the following.

"Then 'Cache Expiration', Override, 90 days", which at least appears to set the cache-control header in the CDN response.

From the docs I've read, this 'Cache Expiration' setting should also inform the CDN POP to cache for 90 days. However, while testing I have noticed that in visits after 1 day, about 30% of requests are served as 'TCP_REMOTE_HIT' and another 30% as 'TCP_MISS'.

Is the setting for Cache Expiration correct, to specify the cache expiration at the POPs? Or is there some other reason for such quick evacuation of the cache at the POPs.

azure-cdn
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Rem-0323 Where did you configure the rule, is it a global cache rule or a custom rule? If it is currently not a global rule, can you please try to configure it as a global rule and see if it works.

0 Votes 0 ·

It is a custom rule as I'll like to configure the TTL for the items separately. Ideally i'll like to have different TTL for the proxies vs browser cache. Is there a way to set that up with the global rule?

0 Votes 0 ·

@Rem-0323 You cannot add conditions with a global rule. Can you please send me a snapshot of the HTTP Request/response as well as the configured rules so I can better understand what is going on?

0 Votes 0 ·

Configured rules:

142738-cdn-rulesengine.png


Response for spa rule:
142672-sparule-responseheader.png

Response for static rule:
142726-image-responseheader.png


0 Votes 0 ·

@Rem-0323 Can you also post the request header?

0 Votes 0 ·
Show more comments

1 Answer

SaiKishor-MSFT avatar image
0 Votes"
SaiKishor-MSFT answered

@Rem-0323 Thank you for your patience while we were looking into this issue.

  1. Microsoft does code rollouts once a week in production and all services restart fresh i.e., Entire cache is gone.

  2. If the item is not accessed frequently, the item gets evicted out of cache by more popular items. This behavior is expected.

Hope this helps. If you have any further questions/concerns, please do let us know. Thank you!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.