Cloudflare cache not turning off?

Im hosting a API for a school project, when I do a request it will give me a random code each time I call to the endpoint.
However it seems like the code is saved in the cache by cloudflare since it will always return the 2nd last created code back.
When I clear my database off all codes(so it’s fully empty), the api will still return a code that was deleted and generate a new one but that should be impossble since the database has no codes in it.

So far I’ve tried to add multiple page rules related to cache:
Browser Cache TTL: 2 minutes, Cache Level: Bypass, Origin Cache Control: On

I’ve tried turning on/off mulitple cache, purging the cache and other related cache things. But none of them have helped so far.

If you open the Network Tool section on your browser with F12. Do you see that the calls are being cached or showing that they are being cached with Cloudflare?

I don’t see it but if the database is empty and the api does not return the code it just created but the one before that (which has been deleted), where is it getting it from?

You can always turn Cloudflare off for that domain that has the API endpoint wait for the DNS change to go through and make an API call again and see if there is still the same issue.

I have no idea where the generated code could be from as I don’t know your code.

Locally it works fine, only when I put it on the server it goes wrong. But it can’t be my code, that’s one thing im certain off. It’s either some setting IIS which im not aware of or cloudflare, and I suspect cloudflare to be the one. Ill try it without cloudflare but i doubt that would make a difference.

It’s only happening with cloudflare

What is the end point so that I can look at it?

Narrator: It was his code.

What do the headers in the response show? What is the cf-cache-status header value?



^ Answer


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.