|
@@ -174,6 +174,7 @@ func (hs *HTTPServer) newMacaron() *macaron.Macaron {
|
|
|
hs.mapStatic(m, route.Directory, "", pluginRoute)
|
|
hs.mapStatic(m, route.Directory, "", pluginRoute)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ hs.mapStatic(m, setting.StaticRootPath, "build", "public/build")
|
|
|
hs.mapStatic(m, setting.StaticRootPath, "", "public")
|
|
hs.mapStatic(m, setting.StaticRootPath, "", "public")
|
|
|
hs.mapStatic(m, setting.StaticRootPath, "robots.txt", "robots.txt")
|
|
hs.mapStatic(m, setting.StaticRootPath, "robots.txt", "robots.txt")
|
|
|
|
|
|
|
@@ -241,6 +242,12 @@ func (hs *HTTPServer) mapStatic(m *macaron.Macaron, rootDir string, dir string,
|
|
|
c.Resp.Header().Set("Cache-Control", "public, max-age=3600")
|
|
c.Resp.Header().Set("Cache-Control", "public, max-age=3600")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if prefix == "public/build" {
|
|
|
|
|
+ headers = func(c *macaron.Context) {
|
|
|
|
|
+ c.Resp.Header().Set("Cache-Control", "public, max-age=31536000")
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if setting.Env == setting.DEV {
|
|
if setting.Env == setting.DEV {
|
|
|
headers = func(c *macaron.Context) {
|
|
headers = func(c *macaron.Context) {
|
|
|
c.Resp.Header().Set("Cache-Control", "max-age=0, must-revalidate, no-cache")
|
|
c.Resp.Header().Set("Cache-Control", "max-age=0, must-revalidate, no-cache")
|