Download the PHP package stuartcusackie/statamic-cache-requester without Composer
On this page you can find all versions of the php package stuartcusackie/statamic-cache-requester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stuartcusackie/statamic-cache-requester
More information about stuartcusackie/statamic-cache-requester
Files in stuartcusackie/statamic-cache-requester
Package statamic-cache-requester
Short Description Artisan commands that queue up entry and glide urls for retrieval, which engages the caches and makes first time loads much quicker.
License MIT
Informations about the package statamic-cache-requester
Statamic Cache Requester
Artisan commands that queue up entry and glide urls for retrieval, which engages the caches and makes first time loads much quicker. Note that this package provides no benefict to Statamic applications that save cached images, i.e. cache => true.
This package can do a few things:
- Queue up all entry urls for retrieval which automatically engages the static cache, making first time loads quicker. UPDATE: Statamic actually has a built in function for this which should be preferable -
static:warm
- Search for all image and picture sources within your entries and queue them up for a separate retrieval to initiate Glide generation. This means that all images and responsive variants will be pre-generated for your first visitor. This is particularly useful when you have lots of responsive image variants or if you are using Spatie's Statamic Responsive Images package. It can help to avoid server crashes for image heavy websites where Glide has a lot of processing to perform.
- Listens for EntrySaved events and automatically queues the entry's url for image requests.
CAUTION: Glide image manipulation can take a lot of work, especially when using responsive image variants and jpeg fallbacks. For example, a site using Spatie's responsive images addon could have 10 sizes and 2 formats per image. If this site has 1000 images then 20,000 variants will need to be manipulated by Glide. Keep an eye on your CPU usage, especially if using a hosting server that limits CPU (e.g. AWS-EC2).
Installation
Check the config file for special features such as queue configuration and lightbox image request generation.
Commands
If you are using Static caching then it's a good idea to add this command to your deploy script (e.g. Forge). Deployments clear the static cache so this will rebuild it for all entries afterwards.
UPDATE: Statamic actually has a built in function for this which should be preferable - static:warm
You will usually only run this command once on initial deployment of the site, or after any major restructuring of asset filenames and folders. I do not recommend adding this to your deployment script as images rarely change.
Clears the configured queue. Be careful if using the default queue or a shared queue as all jobs will be removed.
Queues
This package utilises a 'cacherequester' queue on the default connection. You can update the queue connection and name using the STATAMIC_CACHE_REQUESTER_QUEUE_CONNECTION and STATAMIC_CACHE_REQUESTER_QUEUE_NAME env variables.
Todo
- Add terms to entry requests
- Add multisite functionality
- Experiment with EntryCreated events to process images
- Remove
All versions of statamic-cache-requester with dependencies
laravel/framework Version ^8.0 || ^9.0 || ^10.0 || ^11.0
statamic/cms Version ^3.0|^4.0|^5.0
simplehtmldom/simplehtmldom Version ^2.0@RC