Skip to content

Instantly share code, notes, and snippets.

@fbrnc
Created December 5, 2012 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbrnc/4218909 to your computer and use it in GitHub Desktop.
Save fbrnc/4218909 to your computer and use it in GitHub Desktop.
Magento Cache Warming
for i in `cat tmp.urls`
  do echo $i
  URLHOSTNAME=`echo "$i" | sed -e 's@.*//\([^/]*\)/*.*@\1@'`
  URLPATH=`echo "$i" | sed -e 's@.*//[^/]*\(/*.*\)@\1@'`
  for varnish in 'varnish1hostname varnish2hostname'; do
curl -H "Accept-Encoding: gzip, deflate" -H "Host: ${URLHOSTNAME}" -s -X GET -I http://$varnish/$URLPATH | egrep 'HTTP/|Age:|X-Cache'
  done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment