Documentation ¶
Overview ¶
Package precompress provides build- and serving-time support for precompressed static resources, to avoid the cost of repeatedly compressing unchanging resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenPrecompressedFile ¶
func OpenPrecompressedFile(w http.ResponseWriter, r *http.Request, path string, fs fs.FS) (fs.File, error)
OpenPrecompressedFile opens a file from fs, preferring compressed versions generated by PrecompressDir if possible.
func Precompress ¶
func PrecompressDir ¶
PrecompressDir compresses static assets in dirPath using Gzip and Brotli, so that they can be later served with OpenPrecompressedFile.
Types ¶
Click to show internal directories.
Click to hide internal directories.