Also cache static files
This commit is contained in:
parent
ebd9ba39d8
commit
5aca62e586
1 changed files with 6 additions and 1 deletions
|
@ -4,9 +4,14 @@ func (g *goDash) setupRouter() {
|
|||
g.router.GET("/", g.index)
|
||||
g.router.GET("/ws", g.ws)
|
||||
g.router.GET("/robots.txt", robots)
|
||||
g.router.Static("/static", "static")
|
||||
|
||||
static := g.router.Group("/static")
|
||||
static.Use(longCacheLifetime)
|
||||
static.Static("/", "static")
|
||||
|
||||
storage := g.router.Group("/storage")
|
||||
storage.Use(longCacheLifetime)
|
||||
storage.Static("/icons", "storage/icons")
|
||||
|
||||
g.router.RouteNotFound("/*", redirectHome)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue