putyourlightson/craft-blitz-cloudfront

CloudFront cache purger for the Blitz plugin.

5.0.0 2024-04-08 15:39 UTC

README

Stable Version Total Downloads

icon.svg

Blitz CloudFront Purger Plugin for Craft CMS

The CloudFront Purger plugin allows the Blitz plugin for Craft CMS to intelligently purge pages cached on AWS CloudFront.

Note that Amazon CloudFront charges for invalidation requests. Since invalidation requests can quickly add up when purging individual URLs, you should be aware of the potential costs. PutYourLightsOn takes no responsibility whatsoever for expenses incurred.

The first 1,000 invalidation paths that you submit per month are free; you pay for each invalidation path over 1,000 in a month. An invalidation path can be for a single file (such as /images/logo.jpg) or for multiple files (such as /images/*). A path that includes the * wildcard counts as one path even if it causes CloudFront to invalidate thousands of files.

Source: docs.aws.amazon.com

License

This plugin requires a free commercial license available through the Craft Plugin Store.

Requirements

This plugin requires Craft CMS 3.0.0 or later, or 4.0.0 or later, or 5.0.0 or later.

Installation

To install the plugin, search for “Blitz CloudFront Purger” in the Craft Plugin Store, or install manually using composer.

composer require putyourlightson/craft-blitz-cloudfront

Usage

Once installed, the CloudFront Purger can be selected in the Blitz plugin settings or in config/blitz.php.

// The purger type to use.
'cachePurgerType' => 'putyourlightson\blitzcloudfront\CloudFrontPurger',

// The purger settings.
'cachePurgerSettings' => [
   'region' => 'us-east-1',
   'apiKey' => 'p_prod_abcdefgh1234567890',
   'apiSecret' => 's_prod_abcdefgh1234567890',
   'distributionId' => '123456789',
   'warmCacheDelay' => '5',
],

Created by PutYourLightsOn.