Edge Cache is not caching hits coming from ampproject CDN. Why?

Hi there,

We are using json to embed comments in our blog, so we can have a better control over caching rules. So there’s 3 cache levels for the comments, each with it’s own string.

But for some reason, when the request comes from the ampproject CDN (tecnoblog-net.cdn.ampproject.org), cloudflare is ignoring the cache and sending hits to the server:

When a post is trending, this number gets BIG really fast.

If yo access the URL in your browser for the first time, “cache-status” will be “MISS”. EVEN if the post is trending for a long time. Then, when you refresh, it changes to “HIT”, but still, Cloudflare keeps hiting the server for the requests coming from ampproject CDN.

I’ve tried changing access-control-allow-origin to a broader config “*”, suspecting that could be a case of ampproject not beeing authorized to hit the json URL, but made no difference.

Any ideas on what else i could try?

Here is the first URL from the screenshot above. Noticed that cache status now should be either “EXPIRED” or “HIT”, since i have already accessed this URL from my browser. But it is still bypassing the cache for requests from ampproject.

https://tecnoblog.net/wp-json/tb-comments/v0/post/344474?v=1.3.5&cacheLevel=1&avatarSize=64&__amp_source_origin=https://tecnoblog.net

16 thousand hits and counting (+2k hits while i was writing this post)

This topic was automatically closed after 30 days. New replies are no longer allowed.