缓存支持ETag和Last-Modified

This commit is contained in:
GoEdgeLab
2021-06-14 11:46:39 +08:00
parent 0fff9186e5
commit 171d6632b7
7 changed files with 62 additions and 4 deletions

View File

@@ -114,6 +114,14 @@ func (this *FileReader) Status() int {
return this.status
}
func (this *FileReader) LastModified() int64 {
stat, err := this.fp.Stat()
if err != nil {
return 0
}
return stat.ModTime().Unix()
}
func (this *FileReader) HeaderSize() int64 {
return int64(this.headerSize)
}