Delicious Brains

Documentation

Cron Setup

WP Offload S3 and the Assets addon rely heavily on cron jobs for background processing, therefore, it’s recommended that a proper cron job is configured. Out of the box WordPress checks for cron jobs on every single page load by firing a request off to wp-cron.php, which is very inaccurate. If a site doesn’t receive any visits for a set amount of time, cron will not run during this period. This is also true of sites that implement full page caching, as WordPress is generally bypassed.

To ensure that cron runs on schedule, you need another method of hitting wp-cron.php. If your site is running on Linux and you have access to SSH you can you use the built in crontab. If not, a cron service can be used.

Regardless of which method you choose, a cron schedule of 10 minutes or less is recommended.

Cron Services

There are various cron services available and most offer a free plan, however, the free plans usually limit the frequency in which cron jobs can be scheduled.

www.easycron.com
www.setcronjob.com

Signup for an account at your chosen provider and proceed to create your first cron job.

My cron jobs - EasyCron.com 2

Enter the URL to your site’s cron file. The free plan at www.easycron.com limits cron jobs to 10 minute intervals.

My cron jobs - EasyCron.com

Cron will now fire every 10 minutes, regardless of whether or not any visits are received.

Crontab

SSH to your server.

ssh username@server.com

Open the crontab. If this is the first time, you may be asked to select an editor. Option 2 (nano) is usually the easiest.

crontab -e

Add a new line to the end of the file, ensuring that you specify the absolute file path to your WordPress install.

*/5 * * * * cd /var/www/example.com/public; php -q wp-cron.php

Hit CTRL X followed by Y to save and exit. Cron will now fire every 5 minutes, regardless of whether or not any visits are received.