There are problems with hashing POST requests.
I used worker Cache POST request example from https://developers.cloudflare.com/workers/examples/cache-post-request/
with Route *.domain/path/
and created a rule:
*.domain/path/
Cache level: cache everything, Edge cache lifetime: minute
But I am getting cf-cache-status: DYNAMIC in the header
Can anyone help me?
I’m not sure if my reading is correct, but rfc2616 seems to suggest that you cannot cache response to a POST
request
Some HTTP methods MUST cause a cache to invalidate an entity. This is
either the entity referred to by the Request-URI, or by the Location
or Content-Location headers (if present). These methods are:
- PUT
- DELETE
- POST
By convention, GET
and HEAD
should retrieve data whereas POST
is expected to send data or make a change which therefore cannot be cached as the whole point is for the request to hit the server. Obviously there are situations where POST
is used just to retrieve data, but the RFC’s MUST is what matters.