nginx - 使用gzip时缺少etag [英] nginx - missing etag when gzip is used
问题描述
如果我设置nginx使用gzip,它会删除任何etag标题。
If I setup nginx to use gzip, it removes any etag header.
这背后的原因是相同的资源不能是逐字节相同的给定gzip有各种压缩级别。
The reasoning behind this is that the same resource cannot be byte-for-byte identical given that gzip has various compression levels.
但是nginx也删除了一个弱etag,这意味着资源在语义上是等价的。这似乎是nginx的错误行为。
But nginx also removes a weak etag, which just means that the resources are semantically equivalent. This seems like incorrect behavior by nginx.
我错过了什么吗?如果没有,有没有办法解决这个问题?
Am I missing something? If not, is there a way to fix this?
推荐答案
您应该升级到nginx 1.7.3或更高版本。
You should upgrade to nginx 1.7.3 or higher.
功能:弱响应实体标签现在保留在响应修改中,而强实体标签则更改为弱。
Feature: weak entity tags are now preserved on response modifications, and strong ones are changed to weak.
这篇关于nginx - 使用gzip时缺少etag的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!