mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -67,6 +67,7 @@ var (
 | 
			
		||||
	// AppVer settings
 | 
			
		||||
	AppVer         string
 | 
			
		||||
	AppBuiltWith   string
 | 
			
		||||
	AppStartTime   time.Time
 | 
			
		||||
	AppName        string
 | 
			
		||||
	AppURL         string
 | 
			
		||||
	AppSubURL      string
 | 
			
		||||
@@ -362,6 +363,7 @@ var (
 | 
			
		||||
	PIDFile       = "/run/gitea.pid"
 | 
			
		||||
	WritePIDFile  bool
 | 
			
		||||
	ProdMode      bool
 | 
			
		||||
	RunMode       string
 | 
			
		||||
	RunUser       string
 | 
			
		||||
	IsWindows     bool
 | 
			
		||||
	HasRobotsTxt  bool
 | 
			
		||||
@@ -837,6 +839,7 @@ func NewContext() {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	RunUser = Cfg.Section("").Key("RUN_USER").MustString(user.CurrentUsername())
 | 
			
		||||
	RunMode = Cfg.Section("").Key("RUN_MODE").MustString("dev")
 | 
			
		||||
	// Does not check run user when the install lock is off.
 | 
			
		||||
	if InstallLock {
 | 
			
		||||
		currentUser, match := IsRunUserMatchCurrentUser(RunUser)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user