353 lines
		
	
	
		
			27 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
		
		
			
		
	
	
			353 lines
		
	
	
		
			27 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| 
								 | 
							
								<!DOCTYPE html>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<html lang="en" data-content_root="../">
							 | 
						|||
| 
								 | 
							
								  <head>
							 | 
						|||
| 
								 | 
							
								    <meta charset="utf-8" />
							 | 
						|||
| 
								 | 
							
								    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
							 | 
						|||
| 
								 | 
							
								  <meta name="viewport" content="width=device-width, initial-scale=1">
							 | 
						|||
| 
								 | 
							
								    <title>Favicons — SearXNG Documentation (2025.2.9+a1e2b2546)</title>
							 | 
						|||
| 
								 | 
							
								    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=6625fa76" />
							 | 
						|||
| 
								 | 
							
								    <link rel="stylesheet" type="text/css" href="../_static/searxng.css?v=52e4ff28" />
							 | 
						|||
| 
								 | 
							
								    <script src="../_static/documentation_options.js?v=09da0b18"></script>
							 | 
						|||
| 
								 | 
							
								    <script src="../_static/doctools.js?v=9a2dae69"></script>
							 | 
						|||
| 
								 | 
							
								    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
							 | 
						|||
| 
								 | 
							
								    <script data-project="searxng" data-version="2025.2.9+a1e2b2546" src="../_static/describe_version.js?v=fa7f30d0"></script>
							 | 
						|||
| 
								 | 
							
								    <link rel="index" title="Index" href="../genindex.html" />
							 | 
						|||
| 
								 | 
							
								    <link rel="search" title="Search" href="../search.html" />
							 | 
						|||
| 
								 | 
							
								    <link rel="next" title="Limiter" href="searx.limiter.html" />
							 | 
						|||
| 
								 | 
							
								    <link rel="prev" title="Answer CAPTCHA from server’s IP" href="answer-captcha.html" /> 
							 | 
						|||
| 
								 | 
							
								  </head><body>
							 | 
						|||
| 
								 | 
							
								    <div class="related" role="navigation" aria-label="Related">
							 | 
						|||
| 
								 | 
							
								      <h3>Navigation</h3>
							 | 
						|||
| 
								 | 
							
								      <ul>
							 | 
						|||
| 
								 | 
							
								        <li class="right" style="margin-right: 10px">
							 | 
						|||
| 
								 | 
							
								          <a href="../genindex.html" title="General Index"
							 | 
						|||
| 
								 | 
							
								             accesskey="I">index</a></li>
							 | 
						|||
| 
								 | 
							
								        <li class="right" >
							 | 
						|||
| 
								 | 
							
								          <a href="../py-modindex.html" title="Python Module Index"
							 | 
						|||
| 
								 | 
							
								             >modules</a> |</li>
							 | 
						|||
| 
								 | 
							
								        <li class="right" >
							 | 
						|||
| 
								 | 
							
								          <a href="searx.limiter.html" title="Limiter"
							 | 
						|||
| 
								 | 
							
								             accesskey="N">next</a> |</li>
							 | 
						|||
| 
								 | 
							
								        <li class="right" >
							 | 
						|||
| 
								 | 
							
								          <a href="answer-captcha.html" title="Answer CAPTCHA from server’s IP"
							 | 
						|||
| 
								 | 
							
								             accesskey="P">previous</a> |</li>
							 | 
						|||
| 
								 | 
							
								        <li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2025.2.9+a1e2b2546)</a> »</li>
							 | 
						|||
| 
								 | 
							
								          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> »</li>
							 | 
						|||
| 
								 | 
							
								        <li class="nav-item nav-item-this"><a href="">Favicons</a></li> 
							 | 
						|||
| 
								 | 
							
								      </ul>
							 | 
						|||
| 
								 | 
							
								    </div>  
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								    <div class="document">
							 | 
						|||
| 
								 | 
							
								      <div class="documentwrapper">
							 | 
						|||
| 
								 | 
							
								        <div class="bodywrapper">
							 | 
						|||
| 
								 | 
							
								          <div class="body" role="main">
							 | 
						|||
| 
								 | 
							
								            
							 | 
						|||
| 
								 | 
							
								  <section id="favicons">
							 | 
						|||
| 
								 | 
							
								<span id="id1"></span><h1>Favicons<a class="headerlink" href="#favicons" title="Link to this heading">¶</a></h1>
							 | 
						|||
| 
								 | 
							
								<aside class="sidebar">
							 | 
						|||
| 
								 | 
							
								<p class="sidebar-title">warning</p>
							 | 
						|||
| 
								 | 
							
								<p>Don’t activate the favicons before reading the documentation.</p>
							 | 
						|||
| 
								 | 
							
								</aside>
							 | 
						|||
| 
								 | 
							
								<nav class="contents local" id="contents">
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="#infrastructure" id="id3">Infrastructure</a></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="#setting-up-the-cache" id="id4">Setting up the cache</a></p>
							 | 
						|||
| 
								 | 
							
								<ul>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="#maintenance-of-the-cache" id="id5">Maintenance of the cache</a></p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="#proxy-configuration" id="id6">Proxy configuration</a></p>
							 | 
						|||
| 
								 | 
							
								<ul>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="#register-resolvers" id="id7">Register resolvers</a></p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</nav>
							 | 
						|||
| 
								 | 
							
								<p>Activating the favicons in SearXNG is very easy, but this <strong>generates a
							 | 
						|||
| 
								 | 
							
								significantly higher load</strong> in the client/server communication and increases
							 | 
						|||
| 
								 | 
							
								resources needed on the server.</p>
							 | 
						|||
| 
								 | 
							
								<p>To mitigate these disadvantages, various methods have been implemented,
							 | 
						|||
| 
								 | 
							
								including a <em>cache</em>.  The cache must be parameterized according to your own
							 | 
						|||
| 
								 | 
							
								requirements and maintained regularly.</p>
							 | 
						|||
| 
								 | 
							
								<p>To activate favicons in SearXNG’s result list, set a default
							 | 
						|||
| 
								 | 
							
								<code class="docutils literal notranslate"><span class="pre">favicon_resolver</span></code> in the <a class="reference internal" href="settings/settings_search.html#settings-search"><span class="std std-ref">search</span></a> settings:</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">search</span><span class="p">:</span>
							 | 
						|||
| 
								 | 
							
								<span class="w">  </span><span class="nt">favicon_resolver</span><span class="p">:</span><span class="w"> </span><span class="s">"duckduckgo"</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<p>By default and without any extensions, SearXNG serves these resolvers:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><code class="docutils literal notranslate"><span class="pre">duckduckgo</span></code></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><code class="docutils literal notranslate"><span class="pre">allesedv</span></code></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><code class="docutils literal notranslate"><span class="pre">google</span></code></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><code class="docutils literal notranslate"><span class="pre">yandex</span></code></p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<p>With the above setting favicons are displayed, the user has the option to
							 | 
						|||
| 
								 | 
							
								deactivate this feature in his settings.  If the user is to have the option of
							 | 
						|||
| 
								 | 
							
								selecting from several <em>resolvers</em>, a further setting is required / but this
							 | 
						|||
| 
								 | 
							
								setting will be discussed <a class="reference internal" href="#register-resolvers"><span class="std std-ref">later</span></a> in this article,
							 | 
						|||
| 
								 | 
							
								first we have to setup the favicons cache.</p>
							 | 
						|||
| 
								 | 
							
								<section id="infrastructure">
							 | 
						|||
| 
								 | 
							
								<h2><a class="toc-backref" href="#id3" role="doc-backlink">Infrastructure</a><a class="headerlink" href="#infrastructure" title="Link to this heading">¶</a></h2>
							 | 
						|||
| 
								 | 
							
								<p>The infrastructure for providing the favicons essentially consists of three
							 | 
						|||
| 
								 | 
							
								parts:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#module-searx.favicons.proxy" title="searx.favicons.proxy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Favicons-Proxy</span></code></a> (aka <em>proxy</em>)</p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#module-searx.favicons.resolvers" title="searx.favicons.resolvers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Favicons-Resolvers</span></code></a> (aka <em>resolver</em>)</p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#module-searx.favicons.cache" title="searx.favicons.cache"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Favicons-Cache</span></code></a> (aka <em>cache</em>)</p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<p>To protect the privacy of users, the favicons are provided via a <em>proxy</em>.  This
							 | 
						|||
| 
								 | 
							
								<em>proxy</em> is automatically activated with the above activation of a <em>resolver</em>.
							 | 
						|||
| 
								 | 
							
								Additional requests are required to provide the favicons: firstly, the <em>proxy</em>
							 | 
						|||
| 
								 | 
							
								must process the incoming requests and secondly, the <em>resolver</em> must make
							 | 
						|||
| 
								 | 
							
								outgoing requests to obtain the favicons from external sources.</p>
							 | 
						|||
| 
								 | 
							
								<p>A <em>cache</em> has been developed to massively reduce both, incoming and outgoing
							 | 
						|||
| 
								 | 
							
								requests.  This <em>cache</em> is also activated automatically with the above
							 | 
						|||
| 
								 | 
							
								activation of a <em>resolver</em>.  In its defaults, however, the <em>cache</em> is minimal
							 | 
						|||
| 
								 | 
							
								and not well suitable for a production environment!</p>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								<section id="setting-up-the-cache">
							 | 
						|||
| 
								 | 
							
								<span id="favicon-cache-setup"></span><h2><a class="toc-backref" href="#id4" role="doc-backlink">Setting up the cache</a><a class="headerlink" href="#setting-up-the-cache" title="Link to this heading">¶</a></h2>
							 | 
						|||
| 
								 | 
							
								<p>To parameterize the <em>cache</em> and more settings of the favicons infrastructure, a
							 | 
						|||
| 
								 | 
							
								<a class="reference external" href="https://toml.io/en/">TOML</a> configuration is created in the file <code class="docutils literal notranslate"><span class="pre">/etc/searxng/favicons.toml</span></code>.</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[favicons]</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="n">cfg_schema</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w">   </span><span class="c1"># config's schema version no.</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="k">[favicons.cache]</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="n">db_url</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"/var/cache/searxng/faviconcache.db"</span><span class="w">  </span><span class="c1"># default: "/tmp/faviconcache.db"</span>
							 | 
						|||
| 
								 | 
							
								<span class="n">LIMIT_TOTAL_BYTES</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2147483648</span><span class="w">                 </span><span class="c1"># 2 GB / default: 50 MB</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># HOLD_TIME = 5184000                            # 60 days / default: 30 days</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># BLOB_MAX_BYTES = 40960                         # 40 KB / default 20 KB</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># MAINTENANCE_MODE = "off"                       # default: "auto"</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># MAINTENANCE_PERIOD = 600                       # 10min / default: 1h</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<dl>
							 | 
						|||
| 
								 | 
							
								<dt><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.config.FaviconConfig.cfg_schema" title="searx.favicons.config.FaviconConfig.cfg_schema"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cfg_schema</span></code></a>:</dt><dd><p>Is required to trigger any processes required for future upgrades / don’t
							 | 
						|||
| 
								 | 
							
								change it.</p>
							 | 
						|||
| 
								 | 
							
								</dd>
							 | 
						|||
| 
								 | 
							
								<dt><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.db_url" title="searx.favicons.cache.FaviconCacheConfig.db_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.db_url</span></code></a>:</dt><dd><p>The path to the (<a class="reference external" href="https://www.sqlite.org/">SQLite</a>) database file.  The default path is in the <a class="reference external" href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s18.html">/tmp</a>
							 | 
						|||
| 
								 | 
							
								folder, which is deleted on every reboot and is therefore unsuitable for a
							 | 
						|||
| 
								 | 
							
								production environment.  The <a class="reference external" href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html">FHS</a> provides the folder  for the
							 | 
						|||
| 
								 | 
							
								application cache</p>
							 | 
						|||
| 
								 | 
							
								<p>The <a class="reference external" href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html">FHS</a> provides the folder <a class="reference external" href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s05.html">/var/cache</a> for the cache of applications, so a
							 | 
						|||
| 
								 | 
							
								suitable storage location of SearXNG’s caches is folder <code class="docutils literal notranslate"><span class="pre">/var/cache/searxng</span></code>.
							 | 
						|||
| 
								 | 
							
								In container systems, a volume should be mounted for this folder and in a
							 | 
						|||
| 
								 | 
							
								standard installation (compare <a class="reference internal" href="installation-searxng.html#create-searxng-user"><span class="std std-ref">Create user</span></a>), the folder must be
							 | 
						|||
| 
								 | 
							
								created and the user under which the SearXNG process is running must be given
							 | 
						|||
| 
								 | 
							
								write permission to this folder.</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>mkdir<span class="w"> </span>/var/cache/searxng
							 | 
						|||
| 
								 | 
							
								$<span class="w"> </span>sudo<span class="w"> </span>chown<span class="w"> </span>root:searxng<span class="w"> </span>/var/cache/searxng/
							 | 
						|||
| 
								 | 
							
								$<span class="w"> </span>sudo<span class="w"> </span>chmod<span class="w"> </span>g+w<span class="w"> </span>/var/cache/searxng/
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								</dd>
							 | 
						|||
| 
								 | 
							
								<dt><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.LIMIT_TOTAL_BYTES" title="searx.favicons.cache.FaviconCacheConfig.LIMIT_TOTAL_BYTES"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.LIMIT_TOTAL_BYTES</span></code></a>:</dt><dd><p>Maximum of bytes stored in the cache of all blobs.  The limit is only reached
							 | 
						|||
| 
								 | 
							
								at each maintenance interval after which the oldest BLOBs are deleted; the
							 | 
						|||
| 
								 | 
							
								limit is exceeded during the maintenance period.</p>
							 | 
						|||
| 
								 | 
							
								<div class="admonition attention">
							 | 
						|||
| 
								 | 
							
								<p class="admonition-title">Attention</p>
							 | 
						|||
| 
								 | 
							
								<p>If the maintenance period is too long or maintenance is switched
							 | 
						|||
| 
								 | 
							
								off completely, the cache grows uncontrollably.</p>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								</dd>
							 | 
						|||
| 
								 | 
							
								</dl>
							 | 
						|||
| 
								 | 
							
								<p>SearXNG hosters can change other parameters of the cache as required:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.HOLD_TIME" title="searx.favicons.cache.FaviconCacheConfig.HOLD_TIME"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.HOLD_TIME</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.BLOB_MAX_BYTES" title="searx.favicons.cache.FaviconCacheConfig.BLOB_MAX_BYTES"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.BLOB_MAX_BYTES</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<section id="maintenance-of-the-cache">
							 | 
						|||
| 
								 | 
							
								<h3><a class="toc-backref" href="#id5" role="doc-backlink">Maintenance of the cache</a><a class="headerlink" href="#maintenance-of-the-cache" title="Link to this heading">¶</a></h3>
							 | 
						|||
| 
								 | 
							
								<p>Regular maintenance of the cache is required!  By default, regular maintenance
							 | 
						|||
| 
								 | 
							
								is triggered automatically as part of the client requests:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.MAINTENANCE_MODE" title="searx.favicons.cache.FaviconCacheConfig.MAINTENANCE_MODE"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.MAINTENANCE_MODE</span></code></a> (default <code class="docutils literal notranslate"><span class="pre">auto</span></code>)</p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.cache.FaviconCacheConfig.MAINTENANCE_PERIOD" title="searx.favicons.cache.FaviconCacheConfig.MAINTENANCE_PERIOD"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cache.MAINTENANCE_PERIOD</span></code></a> (default <code class="docutils literal notranslate"><span class="pre">6000</span></code> / 1h)</p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<p>As an alternative to maintenance as part of the client request process, it is
							 | 
						|||
| 
								 | 
							
								also possible to carry out maintenance using an external process. For example,
							 | 
						|||
| 
								 | 
							
								by creating a <a class="extlink-man reference external" href="https://manpages.debian.org/jump?q=crontab">crontab</a> entry for maintenance:</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>python<span class="w"> </span>-m<span class="w"> </span>searx.favicons<span class="w"> </span>cache<span class="w"> </span>maintenance
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<p>The following command can be used to display the state of the cache:</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>python<span class="w"> </span>-m<span class="w"> </span>searx.favicons<span class="w"> </span>cache<span class="w"> </span>state
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								<section id="proxy-configuration">
							 | 
						|||
| 
								 | 
							
								<span id="favicon-proxy-setup"></span><h2><a class="toc-backref" href="#id6" role="doc-backlink">Proxy configuration</a><a class="headerlink" href="#proxy-configuration" title="Link to this heading">¶</a></h2>
							 | 
						|||
| 
								 | 
							
								<p>Most of the options of the <a class="reference internal" href="../src/searx.favicons.html#module-searx.favicons.proxy" title="searx.favicons.proxy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Favicons-Proxy</span></code></a> are
							 | 
						|||
| 
								 | 
							
								already set sensibly with settings from the <a class="reference internal" href="settings/index.html#searxng-settings-yml"><span class="std std-ref">settings.yml</span></a> and should not normally be adjusted.</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[favicons.proxy]</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="n">max_age</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5184000</span><span class="w">             </span><span class="c1"># 60 days / default: 7 days (604800 sec)</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<dl class="simple">
							 | 
						|||
| 
								 | 
							
								<dt><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.proxy.FaviconProxyConfig.max_age" title="searx.favicons.proxy.FaviconProxyConfig.max_age"><code class="xref py py-obj docutils literal notranslate"><span class="pre">max_age</span></code></a>:</dt><dd><p>The <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives">HTTP Cache-Control max-age</a> response directive indicates that the
							 | 
						|||
| 
								 | 
							
								response remains fresh until N seconds after the response is generated.  This
							 | 
						|||
| 
								 | 
							
								setting therefore determines how long a favicon remains in the client’s cache.
							 | 
						|||
| 
								 | 
							
								As a rule, in the favicons infrastructure of SearXNG’s this setting only
							 | 
						|||
| 
								 | 
							
								affects favicons whose byte size exceeds <a class="reference internal" href="#favicon-cache-setup"><span class="std std-ref">BLOB_MAX_BYTES</span></a> (the other favicons that are already in the cache are embedded as
							 | 
						|||
| 
								 | 
							
								<a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs">data URL</a> in the <a class="reference internal" href="../src/searx.favicons.html#searx.favicons.proxy.favicon_url" title="searx.favicons.proxy.favicon_url"><code class="xref py py-obj docutils literal notranslate"><span class="pre">generated</span> <span class="pre">HTML</span></code></a>,
							 | 
						|||
| 
								 | 
							
								which can greatly reduce the number of additional requests).</p>
							 | 
						|||
| 
								 | 
							
								</dd>
							 | 
						|||
| 
								 | 
							
								</dl>
							 | 
						|||
| 
								 | 
							
								<section id="register-resolvers">
							 | 
						|||
| 
								 | 
							
								<span id="id2"></span><h3><a class="toc-backref" href="#id7" role="doc-backlink">Register resolvers</a><a class="headerlink" href="#register-resolvers" title="Link to this heading">¶</a></h3>
							 | 
						|||
| 
								 | 
							
								<p>A <code class="xref py py-obj docutils literal notranslate"><span class="pre">resolver</span></code> is a function that obtains the favicon
							 | 
						|||
| 
								 | 
							
								from an external source.  The resolver functions available to the user are
							 | 
						|||
| 
								 | 
							
								registered with their fully qualified name (<a class="reference external" href="https://en.wikipedia.org/wiki/Fully_qualified_name">FQN</a>) in a <code class="docutils literal notranslate"><span class="pre">resolver_map</span></code>.</p>
							 | 
						|||
| 
								 | 
							
								<p>If no <code class="docutils literal notranslate"><span class="pre">resolver_map</span></code> is defined in the <code class="docutils literal notranslate"><span class="pre">favicon.toml</span></code>, the favicon
							 | 
						|||
| 
								 | 
							
								infrastructure of SearXNG generates this <code class="docutils literal notranslate"><span class="pre">resolver_map</span></code> automatically
							 | 
						|||
| 
								 | 
							
								depending on the <code class="docutils literal notranslate"><span class="pre">settings.yml</span></code>.  SearXNG would automatically generate the
							 | 
						|||
| 
								 | 
							
								following TOML configuration from the following YAML configuration:</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">search</span><span class="p">:</span>
							 | 
						|||
| 
								 | 
							
								<span class="w">  </span><span class="nt">favicon_resolver</span><span class="p">:</span><span class="w"> </span><span class="s">"duckduckgo"</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[favicons.proxy.resolver_map]</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="s2">"duckduckgo"</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"searx.favicons.resolvers.duckduckgo"</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<p>If this automatism is not desired, then (and only then) a separate
							 | 
						|||
| 
								 | 
							
								<code class="docutils literal notranslate"><span class="pre">resolver_map</span></code> must be created.  For example, to give the user two resolvers to
							 | 
						|||
| 
								 | 
							
								choose from, the following configuration could be used:</p>
							 | 
						|||
| 
								 | 
							
								<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[favicons.proxy.resolver_map]</span>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<span class="s2">"duckduckgo"</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"searx.favicons.resolvers.duckduckgo"</span>
							 | 
						|||
| 
								 | 
							
								<span class="s2">"allesedv"</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"searx.favicons.resolvers.allesedv"</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># "google" = "searx.favicons.resolvers.google"</span>
							 | 
						|||
| 
								 | 
							
								<span class="c1"># "yandex" = "searx.favicons.resolvers.yandex"</span>
							 | 
						|||
| 
								 | 
							
								</pre></div>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<div class="admonition note">
							 | 
						|||
| 
								 | 
							
								<p class="admonition-title">Note</p>
							 | 
						|||
| 
								 | 
							
								<p>With each resolver, the resource requirement increases significantly.</p>
							 | 
						|||
| 
								 | 
							
								</div>
							 | 
						|||
| 
								 | 
							
								<p>The number of resolvers increases:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p>the number of incoming/outgoing requests and</p></li>
							 | 
						|||
| 
								 | 
							
								<li><p>the number of favicons to be stored in the cache.</p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<p>In the following we list the resolvers available in the core of SearXNG, but via
							 | 
						|||
| 
								 | 
							
								the <a class="reference external" href="https://en.wikipedia.org/wiki/Fully_qualified_name">FQN</a> it is also possible to implement your own resolvers and integrate them
							 | 
						|||
| 
								 | 
							
								into the <em>proxy</em>:</p>
							 | 
						|||
| 
								 | 
							
								<ul class="simple">
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.resolvers.duckduckgo" title="searx.favicons.resolvers.duckduckgo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.favicons.resolvers.duckduckgo</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.resolvers.allesedv" title="searx.favicons.resolvers.allesedv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.favicons.resolvers.allesedv</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.resolvers.google" title="searx.favicons.resolvers.google"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.favicons.resolvers.google</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								<li><p><a class="reference internal" href="../src/searx.favicons.html#searx.favicons.resolvers.yandex" title="searx.favicons.resolvers.yandex"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.favicons.resolvers.yandex</span></code></a></p></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								</section>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            <div class="clearer"></div>
							 | 
						|||
| 
								 | 
							
								          </div>
							 | 
						|||
| 
								 | 
							
								        </div>
							 | 
						|||
| 
								 | 
							
								      </div>
							 | 
						|||
| 
								 | 
							
								  <span id="sidebar-top"></span>
							 | 
						|||
| 
								 | 
							
								      <div class="sphinxsidebar" role="navigation" aria-label="Main">
							 | 
						|||
| 
								 | 
							
								        <div class="sphinxsidebarwrapper">
							 | 
						|||
| 
								 | 
							
								  
							 | 
						|||
| 
								 | 
							
								    
							 | 
						|||
| 
								 | 
							
								            <p class="logo"><a href="../index.html">
							 | 
						|||
| 
								 | 
							
								              <img class="logo" src="../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
							 | 
						|||
| 
								 | 
							
								            </a></p>
							 | 
						|||
| 
								 | 
							
								  
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<h3><a href="../index.html">Table of Contents</a></h3>
							 | 
						|||
| 
								 | 
							
								<ul class="current">
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1"><a class="reference internal" href="../user/index.html">User information</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1"><a class="reference internal" href="../own-instance.html">Why use a private instance?</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1 current"><a class="reference internal" href="index.html">Administrator documentation</a><ul class="current">
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="settings/index.html">Settings</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-docker.html">Docker Container</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-scripts.html">Installation Script</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-searxng.html">Step by step installation</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-uwsgi.html">uWSGI</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-nginx.html">NGINX</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="installation-apache.html">Apache</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="update-searxng.html">SearXNG maintenance</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="answer-captcha.html">Answer CAPTCHA from server’s IP</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2 current"><a class="current reference internal" href="#">Favicons</a><ul>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l3"><a class="reference internal" href="#infrastructure">Infrastructure</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l3"><a class="reference internal" href="#setting-up-the-cache">Setting up the cache</a><ul>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l4"><a class="reference internal" href="#maintenance-of-the-cache">Maintenance of the cache</a></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l3"><a class="reference internal" href="#proxy-configuration">Proxy configuration</a><ul>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l4"><a class="reference internal" href="#register-resolvers">Register resolvers</a></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="searx.limiter.html">Limiter</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="api.html">Administration API</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="architecture.html">Architecture</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="plugins.html">List of plugins</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l2"><a class="reference internal" href="buildhosts.html">Buildhosts</a></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								</li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1"><a class="reference internal" href="../dev/index.html">Developer documentation</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1"><a class="reference internal" href="../utils/index.html">DevOps tooling box</a></li>
							 | 
						|||
| 
								 | 
							
								<li class="toctree-l1"><a class="reference internal" href="../src/index.html">Source-Code</a></li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								  <h3>Project Links</h3>
							 | 
						|||
| 
								 | 
							
								  <ul>
							 | 
						|||
| 
								 | 
							
								    <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
							 | 
						|||
| 
								 | 
							
								  
							 | 
						|||
| 
								 | 
							
								    <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
							 | 
						|||
| 
								 | 
							
								  
							 | 
						|||
| 
								 | 
							
								    <li><a href="https://searx.space">Public instances</a>
							 | 
						|||
| 
								 | 
							
								  
							 | 
						|||
| 
								 | 
							
								    <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
							 | 
						|||
| 
								 | 
							
								  </ul><h3>Navigation</h3>
							 | 
						|||
| 
								 | 
							
								<ul>
							 | 
						|||
| 
								 | 
							
								  <li><a href="../index.html">Overview</a>
							 | 
						|||
| 
								 | 
							
								    <ul>
							 | 
						|||
| 
								 | 
							
								      <li><a href="index.html">Administrator documentation</a>
							 | 
						|||
| 
								 | 
							
								        <ul>
							 | 
						|||
| 
								 | 
							
								          <li>Previous: <a href="answer-captcha.html" title="previous chapter">Answer CAPTCHA from server’s IP</a>
							 | 
						|||
| 
								 | 
							
								          <li>Next: <a href="searx.limiter.html" title="next chapter">Limiter</a></ul>
							 | 
						|||
| 
								 | 
							
								      </li>
							 | 
						|||
| 
								 | 
							
								    </ul>
							 | 
						|||
| 
								 | 
							
								  </li>
							 | 
						|||
| 
								 | 
							
								</ul>
							 | 
						|||
| 
								 | 
							
								<search id="searchbox" style="display: none" role="search">
							 | 
						|||
| 
								 | 
							
								  <h3 id="searchlabel">Quick search</h3>
							 | 
						|||
| 
								 | 
							
								    <div class="searchformwrapper">
							 | 
						|||
| 
								 | 
							
								    <form class="search" action="../search.html" method="get">
							 | 
						|||
| 
								 | 
							
								      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
							 | 
						|||
| 
								 | 
							
								      <input type="submit" value="Go" />
							 | 
						|||
| 
								 | 
							
								    </form>
							 | 
						|||
| 
								 | 
							
								    </div>
							 | 
						|||
| 
								 | 
							
								</search>
							 | 
						|||
| 
								 | 
							
								<script>document.getElementById('searchbox').style.display = "block"</script>
							 | 
						|||
| 
								 | 
							
								  <div role="note" aria-label="source link">
							 | 
						|||
| 
								 | 
							
								    <h3>This Page</h3>
							 | 
						|||
| 
								 | 
							
								    <ul class="this-page-menu">
							 | 
						|||
| 
								 | 
							
								      <li><a href="../_sources/admin/searx.favicons.rst.txt"
							 | 
						|||
| 
								 | 
							
								            rel="nofollow">Show Source</a></li>
							 | 
						|||
| 
								 | 
							
								    </ul>
							 | 
						|||
| 
								 | 
							
								   </div>
							 | 
						|||
| 
								 | 
							
								        </div>
							 | 
						|||
| 
								 | 
							
								      </div>
							 | 
						|||
| 
								 | 
							
								      <div class="clearer"></div>
							 | 
						|||
| 
								 | 
							
								    </div>
							 | 
						|||
| 
								 | 
							
								    <div class="footer" role="contentinfo">
							 | 
						|||
| 
								 | 
							
								    © Copyright SearXNG team.
							 | 
						|||
| 
								 | 
							
								    </div>
							 | 
						|||
| 
								 | 
							
								  </body>
							 | 
						|||
| 
								 | 
							
								</html>
							 |