支持自动转换图像文件为WebP

This commit is contained in:
GoEdgeLab
2021-10-01 16:24:17 +08:00
parent ce9541ef8b
commit 300c11041f
5 changed files with 124 additions and 46 deletions

View File

@@ -338,6 +338,11 @@ func (this *HTTPRequest) configureWeb(web *serverconfigs.HTTPWebConfig, isTop bo
this.web.Compression = web.Compression
}
// webp
if web.WebP != nil && (web.WebP.IsPrior || isTop) {
this.web.WebP = web.WebP
}
// cache
if web.Cache != nil && (web.Cache.IsPrior || isTop) {
this.web.Cache = web.Cache