@@ -33,7 +33,6 @@ Nottingham's `Cache Tutorial`_.
33
33
.. index ::
34
34
single: Cache; Proxy
35
35
single: Cache; Reverse proxy
36
- single: Cache; Gateway
37
36
38
37
.. _gateway-caches :
39
38
@@ -286,10 +285,14 @@ Safe Methods: Only caching GET or HEAD requests
286
285
HTTP caching only works for "safe" HTTP methods (like GET and HEAD). This means
287
286
two things:
288
287
289
- * Don't try to cache PUT, POST or DELETE requests. It won't work and with good
290
- reason. These methods are meant to be used when mutating the state of your application
288
+ * Don't try to cache PUT or DELETE requests. It won't work and with good reason.
289
+ These methods are meant to be used when mutating the state of your application
291
290
(e.g. deleting a blog post). Caching them would prevent certain requests from hitting
292
- and mutating your application. (Technically caching POST requests is possible however this is very narrow case `Caching POST `_
291
+ and mutating your application.
292
+
293
+ * POST requests are generally considered uncachable, but `they can be cached `_
294
+ when they include explicit freshness information. However POST caching is not
295
+ widely implemented, so you should avoid it if possible.
293
296
294
297
* You should *never * change the state of your application (e.g. update a blog post)
295
298
when responding to a GET or HEAD request. If those requests are cached, future
@@ -366,4 +369,4 @@ Learn more
366
369
.. _`RFC 7234 - Caching` : https://tools.ietf.org/html/rfc7234
367
370
.. _`RFC 7232 - Conditional Requests` : https://tools.ietf.org/html/rfc7232
368
371
.. _`FOSHttpCacheBundle` : http://foshttpcachebundle.readthedocs.org/
369
- .. _`Caching POST ` : https://www.mnot.net/blog/2012/09/24/caching_POST
372
+ .. _`they can be cached ` : https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-20#section-2.3.4
0 commit comments