From b110f86b489b97551fb33c9a4e5d641c8d912778 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 26 Jan 2024 10:43:03 -0500 Subject: [PATCH] ops: Add new nginx hot cacher --- production/nginx-cache-heater | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 production/nginx-cache-heater diff --git a/production/nginx-cache-heater b/production/nginx-cache-heater new file mode 100755 index 000000000..00fc6ea7a --- /dev/null +++ b/production/nginx-cache-heater @@ -0,0 +1,24 @@ +#!/usr/bin/env zsh +hostname=mempool.space + +heat() +{ + echo "$1" + curl -i -s "$1" | head -1 +} + +heatURLs=( + '/api/v1/fees/recommended' +) + +while true +do + echo "starting heat cache cycle..." + + for url in $heatURLs + do + heat "https://${hostname}${url}" + done + + sleep 0.5 +done