Skip to content

CloudFront cache purger for the Blitz plugin for Craft CMS.

License

Notifications You must be signed in to change notification settings

levin-riegner/craft-blitz-cloudfront

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blitz CloudFront Purger for Craft CMS

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

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.

No additional charge for the first 1,000 paths requested for invalidation each month. Thereafter, $0.005 per path requested for invalidation.

A path listed in your invalidation request represents the URL (or multiple URLs if the path contains a wildcard character) of the object(s) you want to invalidate from CloudFront cache.

Source: aws.amazon.com/cloudfront/pricing

Usage

Install the purger using composer.

composer require putyourlightson/craft-blitz-cloudfront

Then add the class to the cachePurgerTypes config setting in config/blitz.php.

// The purger type classes to add to the plugin’s default purger types.
'cachePurgerTypes' => [
    'putyourlightson\blitz\drivers\purgers\CloudflarePurger',
    'putyourlightson\blitzcloudfront\CloudFrontPurger',
],

You can then select the purger and settings either in the control panel 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',
],

Documentation

Read the documentation at putyourlightson.com/plugins/blitz.

Created by PutYourLightsOn.

About

CloudFront cache purger for the Blitz plugin for Craft CMS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 83.3%
  • HTML 16.7%