Marco Altieri
Marco Altieri

Reputation: 3818

Cloudflare refresh resource

I am thinking to use cloudflare to cache a resource generated by a REST API endpoint.

Because the API can take time to return the result, I am wondering if it is possible to configure cloudflare to refresh the resource in background returning always the cached resource to clients.

Upvotes: 0

Views: 129

Answers (1)

Jules
Jules

Reputation: 2019

You can use page rules on the API endpoint to cache the result for X hours (or days, etc). I think it will have to be GET though, I don't think POST is ever cached.

Upvotes: 1

Related Questions