1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-15 04:51:02 +00:00

support gzip #37

This commit is contained in:
astaxie
2013-04-18 23:13:53 +08:00
parent a3f8fd6a77
commit 140b513c7b
2 changed files with 42 additions and 3 deletions

View File

@ -37,6 +37,7 @@ var (
SessionSavePath string // session savepath if use mysql/redis/file this set to the connectinfo
UseFcgi bool
MaxMemory int64
EnableGzip bool // enable gzip
GlobalSessions *session.Manager //GlobalSessions
)
@ -66,6 +67,7 @@ func init() {
SessionSavePath = ""
UseFcgi = false
MaxMemory = 1 << 26 //64MB
EnableGzip = false
} else {
HttpAddr = AppConfig.String("httpaddr")
if v, err := AppConfig.Int("httpport"); err != nil {
@ -135,6 +137,11 @@ func init() {
} else {
UseFcgi = ar
}
if ar, err := AppConfig.Bool("enablegzip"); err != nil {
EnableGzip = false
} else {
EnableGzip = ar
}
}
StaticDir["/static"] = "static"