Created
December 9, 2014 09:50
-
-
Save herveguetin/f0035f161d851ffe515a to your computer and use it in GitHub Desktop.
Quick, easy and dirty cache warmer based on sitemap.xml
This file contains 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 | |
URL='www.domain.nd' | |
SITEMAP='sitemap.xml' | |
wget --quiet http://$URL/$SITEMAP --no-cache --output-document - | egrep -o "http://$URL[^<]+" | while read line; do | |
time curl -A 'Cache Warmer' -s -L $line > /dev/null 2>&1 | |
echo $line | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wouldn't it be more efficient (less bandwidth use) to use
curl -I
, like:time curl -A 'Cache Warmer' -s -I $line > /dev/null 2>&1