refactor: update cache maxage
This commit is contained in:
parent
3d20bda9cc
commit
ada6d0503e
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
|
@ -29,7 +29,9 @@ func main() {
|
||||||
|
|
||||||
assetFS := middleware.NewEmbedStaticFS(webFS, "web")
|
assetFS := middleware.NewEmbedStaticFS(webFS, "web")
|
||||||
e.GET("/static/*", middleware.NewStaticServe(assetFS, middleware.StaticServeConfig{
|
e.GET("/static/*", middleware.NewStaticServe(assetFS, middleware.StaticServeConfig{
|
||||||
// 缓存服务器缓存一个小时
|
// 客户端缓存
|
||||||
|
MaxAge: 10 * time.Minute,
|
||||||
|
// 缓存服务器缓存
|
||||||
SMaxAge: 5 * time.Minute,
|
SMaxAge: 5 * time.Minute,
|
||||||
DenyQueryString: true,
|
DenyQueryString: true,
|
||||||
DisableLastModified: true,
|
DisableLastModified: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue