diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-09-22 07:50:09 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2023-09-25 22:52:23 +0200 |
commit | 51bcd95a754eca6d5a3420615ac6c3c37c993702 (patch) | |
tree | ee4650cd3b582d1578f6a9524cfa3419074ce515 /utils/templates | |
parent | 3c6549a17f886b90a8e700810f9e1aea86581966 (diff) | |
download | searxng-51bcd95a754eca6d5a3420615ac6c3c37c993702.tar.gz searxng-51bcd95a754eca6d5a3420615ac6c3c37c993702.zip |
[fix] harmonize default settings for caching of /static files
Caching files on the client side for more than a day can confuse the end user
when updating static files[1].
Depending on the way of providing a SearXNG instance via HTTP, there are several
ways to optimize the access to the /static files. However, since we don't know
what optimization an admin has provided for his static files, we should have
moderate settings in the defaults that run robustly in a wide variety of
installations.
In this sense, all caches on the client side should be cleared after one day at
the latest. So far the files were cached for one year on client side; as soon
as changes are made to the static files (with the option `static_use_hash:
true`) the old static files are kept for one year on the CLient side / which can
also be evaluated as unnecessary caching.
[1] https://github.com/searxng/searxng/discussions/2821
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/templates')
4 files changed, 8 insertions, 8 deletions
diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini index 14005ad56..351965a1e 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini @@ -78,7 +78,7 @@ buffer-size = 8192 # static_use_hash: true # static-map = /static=${SEARXNG_STATIC} -# expires set to one year since there are hashes -static-expires = /* 31557600 +# expires set to one day +static-expires = /* 86400 static-gzip-all = True offload-threads = %k diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket index 932b8eeb6..0f36e4178 100644 --- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket @@ -75,7 +75,7 @@ buffer-size = 8192 # static_use_hash: true # static-map = /static=${SEARXNG_STATIC} -# expires set to one year since there are hashes -static-expires = /* 31557600 +# expires set to one day +static-expires = /* 86400 static-gzip-all = True offload-threads = %k diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini b/utils/templates/etc/uwsgi/apps-available/searxng.ini index 7e39ef15a..caefdf0bb 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini @@ -81,7 +81,7 @@ buffer-size = 8192 # static_use_hash: true # static-map = /static=${SEARXNG_STATIC} -# expires set to one year since there are hashes -static-expires = /* 31557600 +# expires set to one day +static-expires = /* 86400 static-gzip-all = True offload-threads = %k diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket index 2505dccf6..516787be1 100644 --- a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket +++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket @@ -78,7 +78,7 @@ buffer-size = 8192 # static_use_hash: true # static-map = /static=${SEARXNG_STATIC} -# expires set to one year since there are hashes -static-expires = /* 31557600 +# expires set to one day +static-expires = /* 86400 static-gzip-all = True offload-threads = %k |