From 55652130a801bd23bdf1fb13148c1dd7cb6841c1 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 28 Jan 2022 13:32:03 +0000 Subject: [PATCH] Enable nginx warm cache for mining pools API data --- production/nginx-cache-warmer | 30 ++++++++++++++++++++---------- production/nginx/location-api.conf | 3 +++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/production/nginx-cache-warmer b/production/nginx-cache-warmer index b84ece171..39855fac3 100755 --- a/production/nginx-cache-warmer +++ b/production/nginx-cache-warmer @@ -1,16 +1,26 @@ #!/usr/bin/env zsh hostname=$(hostname) while true -do for url in /api/v1/statistics/2h \ - /api/v1/statistics/24h \ - /api/v1/statistics/1w \ - /api/v1/statistics/1m \ - /api/v1/statistics/3m \ - /api/v1/statistics/6m \ - /api/v1/statistics/1y \ - /api/v1/statistics/2y \ - /api/v1/statistics/3y \ - / +do for url in / \ + '/api/v1/statistics/2h' \ + '/api/v1/statistics/24h' \ + '/api/v1/statistics/1w' \ + '/api/v1/statistics/1m' \ + '/api/v1/statistics/3m' \ + '/api/v1/statistics/6m' \ + '/api/v1/statistics/1y' \ + '/api/v1/statistics/2y' \ + '/api/v1/statistics/3y' \ + '/api/v1/mining/pools?interval=24h' \ + '/api/v1/mining/pools?interval=3d' \ + '/api/v1/mining/pools?interval=1w' \ + '/api/v1/mining/pools?interval=1m' \ + '/api/v1/mining/pools?interval=3m' \ + '/api/v1/mining/pools?interval=6m' \ + '/api/v1/mining/pools?interval=1y' \ + '/api/v1/mining/pools?interval=2y' \ + '/api/v1/mining/pools?interval=3y' \ + do curl -s "https://${hostname}${url}" >/dev/null done diff --git a/production/nginx/location-api.conf b/production/nginx/location-api.conf index 67b77a714..376818a82 100644 --- a/production/nginx/location-api.conf +++ b/production/nginx/location-api.conf @@ -1,6 +1,9 @@ location /api/v1/statistics { try_files /dev/null @mempool-api-v1-warmcache; } +location /api/v1/mining/pools { + try_files /dev/null @mempool-api-v1-warmcache; +} location /api/v1 { try_files /dev/null @mempool-api-v1-coldcache; }