I want to cache two endpoints (URLS) which return JSON content and are hosted on a Kinsta server.
Requests for both endpoints follow the same pattern like:
I want each unique request to cache for a day.
I have set up page rules for the urls like so:
Cache Level: Cache Everything, Edge Cache TTL: a day Enabled
Cache Level: Cache Everything, Edge Cache TTL: a day
However, after repeated testing, I still get “Cf-Cache-Status: DYNAMIC”. Can anyone help me identify what’s not working with this setup?
Full response headers:
Fri, 27 Aug 2021 11:16:57 GMT
h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
It looks like this is Kinsta, and it’s quite likely that they control your Cloudflare settings, so your rules are being ignored. Have you asked them about this?
Thanks for your reply.
This site isn’t using the Kinsta Cloudflare integration, just a standard setup on Cloudflare so I don’t know how Kinsta would override the Cloudflare settings without it showing up in the headers?
I have asked them and they thought it would be something to sort out on the Cloudflare side. However, I’ll go back to them next week to have them take another look.
But I do see something in the headers:
My suspicion, now that I think about it, is that if you point your DNS entry to Kinsta, it’s already proxied by Cloudflare for Kinsta, so their settings take precedence.
Have you tried any other types of Page Rules, such as a Forwarding URL for some made-up path to see if that happens?
And just now I decide to actually look at that hostname. It’s a CNAME to Kinsta:
api.websitecarbon.com is an alias for websitecarbonapi.hosting.kinsta.cloud.
No wonder your settings aren’t working.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.