mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-28 00:06:35 +08:00
优化Partial Content缓存
This commit is contained in:
@@ -326,7 +326,7 @@ func (this *HTTPWriter) PrepareCache(resp *http.Response, size int64) {
|
||||
// 写入Header
|
||||
var headerBuf = utils.SharedBufferPool.Get()
|
||||
for k, v := range this.Header() {
|
||||
if k == "Set-Cookie" {
|
||||
if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") {
|
||||
continue
|
||||
}
|
||||
for _, v1 := range v {
|
||||
@@ -649,7 +649,7 @@ func (this *HTTPWriter) PrepareCompression(resp *http.Response, size int64) {
|
||||
// 写入Header
|
||||
var headerBuffer = utils.SharedBufferPool.Get()
|
||||
for k, v := range this.Header() {
|
||||
if k == "Set-Cookie" {
|
||||
if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") {
|
||||
continue
|
||||
}
|
||||
for _, v1 := range v {
|
||||
@@ -1193,7 +1193,7 @@ func (this *HTTPWriter) finishRequest() {
|
||||
// 计算Header长度
|
||||
func (this *HTTPWriter) calculateHeaderLength() (result int) {
|
||||
for k, v := range this.Header() {
|
||||
if k == "Set-Cookie" {
|
||||
if k == "Set-Cookie" || (this.isPartial && k == "Content-Range") {
|
||||
continue
|
||||
}
|
||||
for _, v1 := range v {
|
||||
|
||||
Reference in New Issue
Block a user