Skip to content

Instantly share code, notes, and snippets.

@JPustkuchen
Created January 15, 2018 12:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPustkuchen/f185bee60c5a36211cdf6f1c8f6deebe to your computer and use it in GitHub Desktop.
Save JPustkuchen/f185bee60c5a36211cdf6f1c8f6deebe to your computer and use it in GitHub Desktop.
#!/bin/bash
# CACHE WARMER script for XML Sitemaps with MULTIPLE SUB-SITEMAPS:
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