Created
May 22, 2021 07:43
-
-
Save eksiscloud/918eeef63db2f423f834f2306bdb6151 to your computer and use it in GitHub Desktop.
Cache Warmer using sitemap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CACHE WARMER script for XML Sitemaps with MULTIPLE SUB-SITEMAPS: | |
# from: https://gist.github.com/JPustkuchen/f185bee60c5a36211cdf6f1c8f6deebe | |
# chmod u+x | |
DOMAIN='https://www.xyz.com' | |
wget -q $DOMAIN/sitemap.xml --no-cache -O - | egrep -o "$DOMAIN[^<]+" | while read subsite; | |
do | |
echo --- Reading sub-sitemap: $subsite: --- | |
wget -q $subsite --no-cache -O - | egrep -o "$DOMAIN[^<]+" | while read line; | |
do | |
echo $line: | |
time curl -A 'Cache Warmer' -s -L $line > /dev/null 2>&1 | |
done | |
echo --- FINISHED reading sub-sitemap: $subsite: --- | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment