How to use
After you have installed Scheduled Cache Invalidator for Statamic there's just two things you'll need to do.
Include the command
Running the command differs based on the app structure you're using.
After doing this, no other configuration is needed - but don't forget to check your Static Cache invalidation rules for Statamic - these are in your site's config/statamic/static_caching.php
file.
Laravel 11 (new app structure)
If you have adopted the new app structure introduced with Laravel 11, you'll need to update your site's routes/console.php file, and run the Scheduled Cache Invalidator command.
1use Illuminate\Support\Facades\Schedule;2 3Schedule::command('statamic:scheduled-cache-invalidator:run');
Laravel 10 (or old app structure)
In your site's app/Console/Kernel.php
file, run the Scheduled Cache Invalidator command:
1protected function schedule(Schedule $schedule)2{3 $schedule->command('statamic:scheduled-cache-invalidator:run');4}
Set up Laravel's Task Scheduler
The Scheduled Cache Invalidator command will be run from Laravel's Task Scheduler.
You will need to do this on your server, and how you tackle this can vary. You may want to refer to Laravel's docs for more details.
If you're using Laravel Forge, you can simply flick the toggle switch on your Site's main page to have Forge set this up for you.