Django Book 翻译
菜单>:
TOC
返回
原文:
The advantage to using the ``vary_on_headers`` decorator rather than manually setting the ``Vary`` header (using something like ``response['Vary'] = 'user-agent'`` ) is that the decorator *adds* to the ``Vary`` header (which may already exist), rather than setting it from scratch and potentially overriding anything that was already in there.
翻译:
使用 ``vary_on_headers`` 修饰器而不是手动设置 ``Vary`` 头标(使用像 ``response['Vary'] = 'user-agent'`` 之类的代码)的好处是修饰器在(可能已经存在的) ``Vary`` 之上进行 *添加* ,而不是从零开始设置,且可能覆盖该处已经存在的设置。
备注:
译者: