mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 15:10:55 +00:00
Merge pull request #4014 from jianzhiyao/develop
over size file do not run openFile
This commit is contained in:
commit
b9fbcbd906
@ -68,6 +68,10 @@ func serverStaticRouter(ctx *context.Context) {
|
|||||||
http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath)
|
http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
} else if fileInfo.Size() > int64(BConfig.WebConfig.StaticCacheFileSize) {
|
||||||
|
//over size file serve with http module
|
||||||
|
http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var enableCompress = BConfig.EnableGzip && isStaticCompress(filePath)
|
var enableCompress = BConfig.EnableGzip && isStaticCompress(filePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user