From 7ab577a1fba43578b77f56b76275d0e65d03b318 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 19 Aug 2024 17:47:54 +0200 Subject: [mod] Revision of the favicon solution All favicons implementations have been documented and moved to the Python package: searx.favicons There is a configuration (based on Pydantic) for the favicons and all its components: searx.favicons.config A solution for caching favicons has been implemented: searx.favicon.cache If the favicon is already in the cache, the returned URL is a data URL [1] (something like `data:image/png;base64,...`). By generating a data url from the FaviconCache, additional HTTP roundtripps via the favicon_proxy are saved: favicons.proxy.favicon_url The favicon proxy service now sets a HTTP header "Cache-Control: max-age=...": favicons.proxy.favicon_proxy The resolvers now also provide the mime type (data, mime): searx.favicon.resolvers [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs Signed-off-by: Markus Heiser --- searx/favicons/favicons.toml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 searx/favicons/favicons.toml (limited to 'searx/favicons/favicons.toml') diff --git a/searx/favicons/favicons.toml b/searx/favicons/favicons.toml new file mode 100644 index 000000000..0e433d3aa --- /dev/null +++ b/searx/favicons/favicons.toml @@ -0,0 +1,25 @@ +[favicons] + +cfg_schema = 1 # config's schema version no. + +[favicons.proxy] + +# max_age = 5184000 # 60 days / default: 7 days (604800 sec) + +# [favicons.proxy.resolver_map] +# +# The available favicon resolvers are registered here. +# +# "duckduckgo" = "searx.favicons.resolvers.duckduckgo" +# "allesedv" = "searx.favicons.resolvers.allesedv" +# "google" = "searx.favicons.resolvers.google" +# "yandex" = "searx.favicons.resolvers.yandex" + +[favicons.cache] + +# db_url = "/var/cache/searxng/faviconcache.db" # default: "/tmp/faviconcache.db" +# HOLD_TIME = 5184000 # 60 days / default: 30 days +# LIMIT_TOTAL_BYTES = 2147483648 # 2 GB / default: 50 MB +# BLOB_MAX_BYTES = 40960 # 40 KB / default 20 KB +# MAINTENANCE_MODE = "off" # default: "auto" +# MAINTENANCE_PERIOD = 600 # 10min / default: 1h \ No newline at end of file -- cgit v1.2.3