mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-04 22:55:48 +08:00
优化Partial Content内容缓存,现在可以使用“部分文件缓存+部分回源”的方式提供内容
This commit is contained in:
@@ -88,6 +88,8 @@ type HTTPWriter struct {
|
||||
|
||||
cacheReader caches.Reader
|
||||
cacheReaderSuffix string
|
||||
|
||||
statusSent bool
|
||||
}
|
||||
|
||||
// NewHTTPWriter 包装对象
|
||||
@@ -844,6 +846,11 @@ func (this *HTTPWriter) SetSentHeaderBytes(sentHeaderBytes int64) {
|
||||
|
||||
// WriteHeader 写入状态码
|
||||
func (this *HTTPWriter) WriteHeader(statusCode int) {
|
||||
if this.statusSent {
|
||||
return
|
||||
}
|
||||
this.statusSent = true
|
||||
|
||||
if this.rawWriter != nil {
|
||||
this.rawWriter.WriteHeader(statusCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user