mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 00:11:04 +00:00 
			
		
		
		
	- Replace the current vfsgen with our own bindata generator. - zstd is used instead of gzip. This reduces the size of the resulting binary by 2MiB, the size of the bundled assets were thus reduced from 13MiB to 11MiB. - If [the browser accepts zstd encoding](https://caniuse.com/zstd), then the compressed bytes can be served directly, otherwise it falls back to being compressed by gzip if it's not disabled via `[server].ENABLE_GZIP` - The compression and decompression speed is roughly 4 times faster. - The generated filesystem is now of type `fs.Fs` instead of `http.FileSystem`, this slightly simplifies the generated code and handling of the assets. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8143 Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			462 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			462 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2016 The Gitea Authors. All rights reserved.
 | 
						|
// SPDX-License-Identifier: MIT
 | 
						|
 | 
						|
//go:build bindata
 | 
						|
 | 
						|
package public
 | 
						|
 | 
						|
import (
 | 
						|
	"time"
 | 
						|
 | 
						|
	"forgejo.org/modules/assetfs"
 | 
						|
	"forgejo.org/modules/timeutil"
 | 
						|
)
 | 
						|
 | 
						|
// GlobalModTime provide a global mod time for embedded asset files
 | 
						|
func GlobalModTime(filename string) time.Time {
 | 
						|
	return timeutil.GetExecutableModTime()
 | 
						|
}
 | 
						|
 | 
						|
func BuiltinAssets() *assetfs.Layer {
 | 
						|
	return assetfs.Bindata("builtin(bindata)", Assets)
 | 
						|
}
 |