diff --git a/production/mempool-start-all b/production/mempool-start-all index 0fc9b17c9..b01fe8aff 100755 --- a/production/mempool-start-all +++ b/production/mempool-start-all @@ -24,7 +24,13 @@ done # start nginx warm cacher for site in mainnet;do echo "starting mempool cache warmer: ${site}" - screen -dmS "warmer-${site}" $HOME/mainnet/production/nginx-cache-warmer + screen -dmS "warmer-${site}" $HOME/mempool/production/nginx-cache-warmer +done + +# start nginx hot cacher +for site in mainnet;do + echo "starting mempool cache heater: ${site}" + screen -dmS "heater-${site}" $HOME/mempool/production/nginx-cache-heater done exit 0 diff --git a/production/nginx-cache-warmer b/production/nginx-cache-warmer index 53dfe185a..f02091747 100755 --- a/production/nginx-cache-warmer +++ b/production/nginx-cache-warmer @@ -39,7 +39,6 @@ warmUnfurlURLs=( ) warmURLs=( - '/api/v1/fees/recommended' '/api/v1/blocks' '/api/v1/statistics/2h' '/api/v1/statistics/24h' diff --git a/production/nginx/location-api.conf b/production/nginx/location-api.conf index 4947ad530..f245154a0 100644 --- a/production/nginx/location-api.conf +++ b/production/nginx/location-api.conf @@ -23,7 +23,7 @@ location /api/v1/mining { try_files /dev/null @mempool-api-v1-cache-warm; } location /api/v1/fees/recommended { - try_files /dev/null @mempool-api-v1-cache-warm; + try_files /dev/null @mempool-api-v1-cache-hot; } # it's ok to cache blockchain data "forever", so we do 30d @@ -84,6 +84,21 @@ location @mempool-api-v1-cache-forever { expires 30d; } +location @mempool-api-v1-cache-hot { + proxy_pass $mempoolMainnet; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_cache_background_update on; + proxy_cache_use_stale updating; + proxy_cache api; + proxy_cache_valid 200 1s; + proxy_redirect off; +} + location @mempool-api-v1-cache-warm { proxy_pass $mempoolMainnet;