aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-11-17 23:44:52 +0100
committerGitHub <noreply@github.com>2020-11-17 17:44:52 -0500
commit0615b668dcbdeb8819662f2532cd5843f427dbcc (patch)
tree240a16a14d8ab503c83b75b25617c8275bc450d0 /main.go
parent9ec5e6c40b0c0e4a8009acbdd5dfea8c0e60cfcd (diff)
downloadgitea-0615b668dcbdeb8819662f2532cd5843f427dbcc.tar.gz
gitea-0615b668dcbdeb8819662f2532cd5843f427dbcc.zip
HTTP cache rework and enable caching for storage assets (#13569)
This enabled HTTP time-based cache for storage assets, primarily avatars. I have not observed If-Modified-Since from browsers during tests but I guess it's good to support regardless. It introduces a new generic httpcache module that can handle both time-based and etag-based caching. Additionally, manifest.json and robots.txt are now also cachable.
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.go b/main.go
index e4fe220e8a..8ee6ffa92c 100644
--- a/main.go
+++ b/main.go
@@ -11,6 +11,7 @@ import (
"os"
"runtime"
"strings"
+ "time"
"code.gitea.io/gitea/cmd"
"code.gitea.io/gitea/modules/log"
@@ -40,6 +41,7 @@ var (
func init() {
setting.AppVer = Version
setting.AppBuiltWith = formatBuiltWith()
+ setting.AppStartTime = time.Now().UTC()
// Grab the original help templates
originalAppHelpTemplate = cli.AppHelpTemplate