diff options
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/handler/router.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/handler/router.go b/pkg/handler/router.go index cb5d6f5..1fbc4e3 100644 --- a/pkg/handler/router.go +++ b/pkg/handler/router.go @@ -55,7 +55,11 @@ func MountHandler( } mux.HandleFunc("/static/{file}", staticHandler) - mux.HandleFunc(fmt.Sprintf("/static/theme%s.css", templates.Slug), cssStaticHandler) // add slug so css file can be cached forever. + // add slug and session so css file can be cached forever. + // Slug follow commit id, which is update every new version + // Session is update every time server restarts, this allows the css to be + // cached forever but refresh if the admin updates the server configuration. + mux.HandleFunc(fmt.Sprintf("/static/theme.%s%s.css", templates.Session, templates.Slug), cssStaticHandler) mux.HandleFunc("/{name}/about/{$}", gitHandler.About) mux.HandleFunc("/{name}", gitHandler.Multiplex) mux.HandleFunc("/{name}/{rest...}", gitHandler.Multiplex) |
