1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-17 01:50:10 +01:00
searxng/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
Markus Heiser 51bcd95a75 [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>
2023-09-25 22:52:23 +02:00

82 lines
1.8 KiB
Plaintext

# -*- mode: conf; coding: utf-8 -*-
[uwsgi]
# uWSGI core
# ----------
#
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
# Who will run the code
uid = ${SERVICE_USER}
gid = ${SERVICE_GROUP}
# set (python) default encoding UTF-8
env = LANG=C.UTF-8
env = LANGUAGE=C.UTF-8
env = LC_ALL=C.UTF-8
# chdir to specified directory before apps loading
chdir = ${SEARXNG_SRC}/searx
# SearXNG configuration (settings.yml)
env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
# disable logging for privacy
logger = systemd
disable-logging = true
# The right granted on the created socket
chmod-socket = 666
# Plugin to use and interpreter config
single-interpreter = true
# enable master process
master = true
# load apps in each worker instead of the master
lazy-apps = true
# load uWSGI plugins
plugin = python
# By default the Python plugin does not initialize the GIL. This means your
# app-generated threads will not run. If you need threads, remember to enable
# them with enable-threads. Running uWSGI in multithreading mode (with the
# threads options) will automatically enable threading support. This *strange*
# default behaviour is for performance reasons.
enable-threads = true
# plugin: python
# --------------
#
# https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
# load a WSGI module
module = searx.webapp
# set PYTHONHOME/virtualenv
virtualenv = ${SEARXNG_PYENV}
# add directory (or glob) to pythonpath
pythonpath = ${SEARXNG_SRC}
# speak to upstream
# -----------------
socket = ${SEARXNG_UWSGI_SOCKET}
buffer-size = 8192
# uWSGI serves the static files and in settings.yml we use::
#
# ui:
# static_use_hash: true
#
static-map = /static=${SEARXNG_STATIC}
# expires set to one day
static-expires = /* 86400
static-gzip-all = True
offload-threads = %k