diff options
author | silverwind <me@silverwind.io> | 2020-12-22 12:13:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 19:13:50 +0800 |
commit | 3a21f8a9865d1112d1b847fb20710e6b735174ec (patch) | |
tree | a0dd55fa92457fec77dabc6d3e83311ec3af8bb9 /routers/routes | |
parent | cd607b5f98ccf66acd99a47309a3411a8e5c8993 (diff) | |
download | gitea-3a21f8a9865d1112d1b847fb20710e6b735174ec.tar.gz gitea-3a21f8a9865d1112d1b847fb20710e6b735174ec.zip |
Inline manifest.json (#14038)
* Inline manifest.json
Improve performance by eliminating this separate request and just inline
this small JSON in HTML directly as a data uri.
Also update previously static app name scripts to use AppName.
I've confirmed this as working via "Add to Homescreen" feature which
offered to save the shortcut under the new app name.
* prerender manifest data on startup
* move to settings
* restore setting.AppStartTime and use it on admin page
* use double quotes because template.URL escapes everything
* fix lint
* move variable to global context variable
* delete template file
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/macaron.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/routers/routes/macaron.go b/routers/routes/macaron.go index 170bc7d493..16977b9470 100644 --- a/routers/routes/macaron.go +++ b/routers/routes/macaron.go @@ -6,12 +6,10 @@ package routes import ( "encoding/gob" - "net/http" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/httpcache" "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/options" @@ -977,13 +975,6 @@ func RegisterMacaronRoutes(m *macaron.Macaron) { private.RegisterRoutes(m) }) - // Progressive Web App - m.Get("/manifest.json", templates.JSONRenderer(), func(ctx *context.Context) { - ctx.Resp.Header().Set("Cache-Control", httpcache.GetCacheControl()) - ctx.Resp.Header().Set("Last-Modified", setting.AppStartTime.Format(http.TimeFormat)) - ctx.HTML(200, "pwa/manifest_json") - }) - // Not found handler. m.NotFound(routers.NotFound) } |