Server Setup

Minimalistic Cache Warmer

by ,


Here’s a simple cron job to warm up your website cache using wget:

@daily /usr/bin/wget --directory-prefix=/tmp --spider --recursive --no-directories --quiet https://www.getpagespeed.com/
  • --spider is for not downloading anything. However, this directive results in files created and deleted. Thus the following directive is useful:
  • --directory-prefix=/tmp ensures that temporary files will end up where they belong.
  • --recursive will force wget to crawl your website recursively.
  • --no-directories will ensure no empty directories are left out after running our minimalistic crawler
  • --quiet is just a good way to silence any output to avoid cron email being sent.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.