mirror of
https://github.com/searxng/searxng-docker.git
synced 2025-12-22 19:50:00 +00:00
[fix] container: remove static hashing (#410)
* [fix] container: remove static hashing Allows browser cache heuristics to properly work. Related https://github.com/searxng/searxng/pull/5006 Closes https://github.com/searxng/searxng-docker/issues/409 * [fix] container: don't revalidate at every request As Granian no longer handles static files directly, the whole process goes through Flask, which apart from being slow, is resource intensive, even to serve HTTP 304 responses.
This commit is contained in:
14
Caddyfile
14
Caddyfile
@@ -42,14 +42,14 @@ encode zstd gzip
|
|||||||
path /stats/checker
|
path /stats/checker
|
||||||
}
|
}
|
||||||
|
|
||||||
@imageproxy {
|
|
||||||
path /image_proxy
|
|
||||||
}
|
|
||||||
|
|
||||||
@static {
|
@static {
|
||||||
path /static/*
|
path /static/*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@imageproxy {
|
||||||
|
path /image_proxy
|
||||||
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
# CSP (https://content-security-policy.com)
|
# CSP (https://content-security-policy.com)
|
||||||
Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self' https:; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self'; img-src * data:; frame-src https:;"
|
Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self' https:; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self'; img-src * data:; frame-src https:;"
|
||||||
@@ -77,9 +77,9 @@ header @api {
|
|||||||
|
|
||||||
route {
|
route {
|
||||||
# Cache policy
|
# Cache policy
|
||||||
header Cache-Control "max-age=0, public, must-revalidate"
|
header Cache-Control "no-cache"
|
||||||
header @imageproxy Cache-Control "max-age=3600, public"
|
header @static Cache-Control "public, max-age=30, stale-while-revalidate=60"
|
||||||
header @static Cache-Control "max-age=31536000, public, immutable"
|
header @imageproxy Cache-Control "public, max-age=3600"
|
||||||
}
|
}
|
||||||
|
|
||||||
# SearXNG
|
# SearXNG
|
||||||
|
|||||||
@@ -5,7 +5,5 @@ server:
|
|||||||
secret_key: "ultrasecretkey" # change this!
|
secret_key: "ultrasecretkey" # change this!
|
||||||
limiter: false # enable this when running the instance for a public usage on the internet
|
limiter: false # enable this when running the instance for a public usage on the internet
|
||||||
image_proxy: true
|
image_proxy: true
|
||||||
ui:
|
|
||||||
static_use_hash: true
|
|
||||||
redis:
|
redis:
|
||||||
url: redis://redis:6379/0
|
url: redis://redis:6379/0
|
||||||
|
|||||||
Reference in New Issue
Block a user