Skip to content

Update http_cache.rst #8442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Nottingham's `Cache Tutorial`_.
.. index::
single: Cache; Proxy
single: Cache; Reverse proxy
single: Cache; Gateway

.. _gateway-caches:

Expand Down Expand Up @@ -286,11 +285,15 @@ Safe Methods: Only caching GET or HEAD requests
HTTP caching only works for "safe" HTTP methods (like GET and HEAD). This means
two things:

* Don't try to cache PUT, POST or DELETE requests. It won't work and with good
reason. These methods are meant to be used when mutating the state of your application
* Don't try to cache PUT or DELETE requests. It won't work and with good reason.
These methods are meant to be used when mutating the state of your application
(e.g. deleting a blog post). Caching them would prevent certain requests from hitting
and mutating your application.

* POST requests are generally considered uncachable, but `they can be cached`_
when they include explicit freshness information. However POST caching is not
widely implemented, so you should avoid it if possible.

* You should *never* change the state of your application (e.g. update a blog post)
when responding to a GET or HEAD request. If those requests are cached, future
requests may not actually hit your server.
Expand Down Expand Up @@ -366,3 +369,4 @@ Learn more
.. _`RFC 7234 - Caching`: https://tools.ietf.org/html/rfc7234
.. _`RFC 7232 - Conditional Requests`: https://tools.ietf.org/html/rfc7232
.. _`FOSHttpCacheBundle`: http://foshttpcachebundle.readthedocs.org/
.. _`they can be cached`: https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-20#section-2.3.4