summaryrefslogtreecommitdiff
path: root/searx/network/network.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-08-25 11:24:27 +0200
committerGitHub <noreply@github.com>2021-08-25 11:24:27 +0200
commit38e0b9360b6a04908c6b8cdbdbd7a15cbdaf19b1 (patch)
tree7c156a017b837e49ecb77ca9886d89e20ef7c069 /searx/network/network.py
parentdec9df28f3e37c5793e53898dd63419660230b4e (diff)
parent697ebeddcc6066e5c5f316c9ef2baf8d3769a868 (diff)
downloadsearxng-38e0b9360b6a04908c6b8cdbdbd7a15cbdaf19b1.tar.gz
searxng-38e0b9360b6a04908c6b8cdbdbd7a15cbdaf19b1.zip
Merge pull request #257 from dalf/mod_image_proxy
Mod image proxy
Diffstat (limited to 'searx/network/network.py')
-rw-r--r--searx/network/network.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/network/network.py b/searx/network/network.py
index e7dc5b56e..94e91593d 100644
--- a/searx/network/network.py
+++ b/searx/network/network.py
@@ -289,6 +289,14 @@ def initialize(settings_engines=None, settings_outgoing=None):
if isinstance(network, str):
NETWORKS[engine_name] = NETWORKS[network]
+ # the /image_proxy endpoint has a dedicated network.
+ # same parameters than the default network, but HTTP/2 is disabled.
+ # It decreases the CPU load average, and the total time is more or less the same
+ if 'image_proxy' not in NETWORKS:
+ image_proxy_params = default_params.copy()
+ image_proxy_params['enable_http2'] = False
+ NETWORKS['image_proxy'] = new_network(image_proxy_params)
+
@atexit.register
def done():