Add nginx cache warmer script for production use

This commit is contained in:
wiz
2022-01-13 15:06:13 +09:00
parent 548f38292f
commit 2cb50c2351
3 changed files with 44 additions and 5 deletions

19
production/nginx-cache-warmer Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env zsh
hostname=$(hostname)
while true
do for url in /url/v1/statistics/2h \
/url/v1/statistics/24h \
/url/v1/statistics/1w \
/url/v1/statistics/1m \
/url/v1/statistics/3m \
/url/v1/statistics/6m \
/url/v1/statistics/1y \
/url/v1/statistics/2y \
/url/v1/statistics/3y \
/
do
curl -s "https://${hostname}${url}" >/dev/null
done
sleep 10
done