Cache POST Responses

Enable caching of POST responses.

How it works

By default, POST requests are passed to the origin. With this behavior enabled, you can override the default, and cache POST responses. To use this behavior, you must enable the Allow POST behavior.

Features and options

FieldWhat it doesSub-options
StatusEnables or disables the behavior.
POST BodyDefine whether and how the POST message body is used for the cache key.
  • Ignore in cache key. Uses only the URL to cache the response.
  • Include an MD5 hash in cache key. Adds a string digest of the data as a query parameter to the cache URL.
  • Include as a query parameter in cache key. Adds the raw request body as a query parameter to the cache key, but only if the POST request’s Content-Type is application/x-www-form-urlencoded. Use this in conjunction with Cache ID Modification to define relevant query parameters.

Related topics

See Allow POST and Cache ID Modification.