Skip to content

Instantly share code, notes, and snippets.

@aheadley
Forked from fbrnc/gist:3418992
Created December 4, 2012 18:56
Show Gist options
  • Save aheadley/4207435 to your computer and use it in GitHub Desktop.
Save aheadley/4207435 to your computer and use it in GitHub Desktop.
Magento Cache Warming
#!/bin/bash
BASE_URL=http://example.com
SITEMAP_PATH=/sitemap.xml
TMP_URL_FILE=sitemap-urls.txt
curl -s "${BASE_URL}${SITEMAP_PATH}" | \
xpath /dev/stdin '/urlset/url/loc/text()' 2>/dev/null | \
sed 's~http:~\nhttp:~g' > "$TMP_URL_FILE"
siege -v -c 1 -H 'Cookie: frontend=no-session' -r once -f "$TMP_URL_FILE"
rm -f "$TMP_URL_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment