Download the PHP package wolfco/craft-cache-cow without Composer
On this page you can find all versions of the php package wolfco/craft-cache-cow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wolfco/craft-cache-cow
More information about wolfco/craft-cache-cow
Files in wolfco/craft-cache-cow
Package craft-cache-cow
Short Description Cache warming service for your Craft CMS application
License proprietary
Homepage https://www.wolfco.us
Informations about the package craft-cache-cow
Cache Cow
This plugin adds a "Warm Cache" button under Utilities > Cache Cow on your Craft CMS control panel. Click it to start the cache warming process on all selected sites.
Cache Cow will look for your sitemap at {webroot}/sitemap.xml
by default, but you can set the path to your own sitemap in plugin settings. Or you can have the plugin read this value from an environment variable, depending on your needs. Multiple sites are supported.
You can enter additional URLs for cache warming in plugin settings (Settings > Plugins > Cache Cow > Settings).
If no URLs are found for warming (i.e. no sitemap exists at the configured path and no additional URLs have been entered), "Warm Cache" button will be disabled and you'll see an error.
You can also do cache warming via console command
By default it fetches all URLs from all configured sitemaps and any additional URLs added in Settings. You can target one or a few site handles by passing them in as a comma-separated list
Use handle custom
to target additional URLs added in Settings.
Requirements
This plugin requires Craft CMS 4.0.0 or later, and PHP 8.2 or later.
Installation
You can install this plugin from the Plugin Store or with Composer.
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Cache Cow”. Then press “Install”.
With Composer
Open your terminal and run the following commands:
Run on a schedule using Cron Job (Linux/macOS)
The Cache Cow plugin provides a command to warm the cache: ./craft cache-cow/cache/warm. You can set this command to run on a regular schedule using a cron job.
To run the cache warming command automatically on a regular schedule, follow these steps:
Step 1: Open the Crontab Editor
Open a terminal and edit the crontab for the user that runs your web server (usually www-data
or a specific user on your server):
Step 2: Add the Cron Job
Add the following line to the crontab file to run the cache warming command. For example, to run the command every hour:
- Replace /path/to/your/craft/installation/ with the actual path to your Craft CMS project.
- The >/dev/null 2>&1 ensures no output is logged unless there's an error.
Example Cron Job for Daily Execution at Midnight To run the cache warming daily at midnight, use this cron job:
[!NOTE]
Steps will vary in a Windows environment
All versions of craft-cache-cow with dependencies
craftcms/cms Version ^4.0.0 || ^5.0.0
vipnytt/sitemapparser Version ^1.3
caseyamcl/guzzle_retry_middleware Version ^2.10.0