WordPress fastcgi cache warmup

In order to reduce the loadup times for my blog I have created a cache warmup script. The script parses the wordpress sitemap and calls all urls via curl. The sitemap is created by Google Sitemap Generator Plugin and contains all urls.

#!/bin/bash
# wp_warmup.sh

cat /var/www/wordpress/sitemap.xml | grep loc | awk -F "<loc>" '{ print $2 }' | awk -F "</loc>" '{ print $1 }'  | sort | uniq | xargs curl -A warmup -silent  >/dev/null

The script is called by this crontab entry every hour:

# m h  dom mon dow   command
0 * * * * /usr/local/bin/wp_warmup.sh

Nginx (based on this config) has to be configured accordingly

fastcgi_cache_valid      200 302 59m;

This combunation works very well. My google response time statistic looks much better now. Google and other search engines use the resposne time for their ranking. This setup will ensure that my website is always fast for the search engines.