Django Book 翻译
菜单>:
TOC
返回
原文:
This middleware provides support for conditional ``GET`` operations. If the response has an ``Last-Modified`` or ``ETag`` or header, and the request has ``If-None-Match`` or ``If-Modified-Since`` , the response is replaced by an 304 (Not modified) response. ``ETag`` support depends on on the ``USE_ETAGS`` setting and expects the ``ETag`` response header to already be set. As discussed above, the ``ETag`` header is set by the Common middleware.
翻译:
这个中间件对条件化 ``GET`` 操作提供支持。如果response头中包括 ``Last-Modified`` 或 ``ETag`` 域,并且request头中包含 ``If-None-Match`` 或 ``If-Modified-Since`` 域,且两者一致,则该response将被response 304(Not modified)取代。对 ``ETag`` 的支持依赖于 ``USE_ETAGS`` 配置及事先在response头中设置 ``ETag`` 域。稍前所讨论的通用中间件可用于设置response中的 ``ETag`` 域。
备注:
译者: