[FEAT] Performance enhancements
This commit is contained in:
24
Caddyfile
24
Caddyfile
@@ -1,16 +1,28 @@
|
||||
http://spritesheetgenerator.online:1337 {
|
||||
root * ./dist
|
||||
encode gzip
|
||||
encode zstd gzip
|
||||
|
||||
# Aggressive caching for static assets
|
||||
@static path *.js *.css *.png *.jpg *.jpeg *.gif *.webp *.svg *.woff *.woff2 *.ico
|
||||
header @static Cache-Control "public, max-age=31536000, immutable"
|
||||
|
||||
# Short cache for HTML (for SPA updates)
|
||||
@html path *.html /
|
||||
header @html Cache-Control "no-cache, must-revalidate"
|
||||
|
||||
# Default cache for everything else
|
||||
header ?Cache-Control "max-age=1800"
|
||||
|
||||
try_files {path} /index.html
|
||||
|
||||
file_server
|
||||
file_server {
|
||||
precompressed zstd gzip
|
||||
}
|
||||
|
||||
log {
|
||||
output file /var/log/caddy/spritesheetgenerator.online.log
|
||||
}
|
||||
}
|
||||
|
||||
header {
|
||||
?Cache-Control "max-age=1800"
|
||||
}
|
||||
:1338 {
|
||||
redir https://spritesheetgenerator.online{uri} permanent
|
||||
}
|
||||
Reference in New Issue
Block a user