Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Created August 4, 2017 11:55
Show Gist options
  • Select an option

  • Save vikramacharya/1b97e739ea4df8571a35898c20e76df8 to your computer and use it in GitHub Desktop.

Select an option

Save vikramacharya/1b97e739ea4df8571a35898c20e76df8 to your computer and use it in GitHub Desktop.
cache warmer based on sitemap.xml
#!/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