PHPackages                             liftric/kirby-cloudfront-invalidations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. liftric/kirby-cloudfront-invalidations

AbandonedArchivedKirby-plugin[Utility &amp; Helpers](/categories/utility)

liftric/kirby-cloudfront-invalidations
======================================

Kirby plugin for automatic slug invalidation in AWS CloudFront

v1.0.6(3y ago)74411[1 issues](https://github.com/Liftric/kirby-cloudfront-invalidations/issues)MITPHP

Since Mar 23Pushed 3y ago3 watchersCompare

[ Source](https://github.com/Liftric/kirby-cloudfront-invalidations)[ Packagist](https://packagist.org/packages/liftric/kirby-cloudfront-invalidations)[ RSS](/packages/liftric-kirby-cloudfront-invalidations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

kirby-cloudfront-invalidations
==============================

[](#kirby-cloudfront-invalidations)

Kirby plugin for automatic slug invalidation in AWS CloudFront

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require liftric/kirby-cloudfront-invalidations

```

Setup
-----

[](#setup)

If you rely on the default credential provider chain, you just need to set the `distributionId`:

```
'liftric.cloudfrontinvalidations.distributionID' => 'YOUR_CF_DISTRIBUTION_ID'
```

Options
-------

[](#options)

### `liftric.cloudfrontinvalidations.distributionID`

[](#liftriccloudfrontinvalidationsdistributionid)

This must be set to your AWS CloudFront distribution ID (available in the AWS CloudFront Distributions dashboard).

### `liftric.cloudfrontinvalidations.awsAccessKeyID`

[](#liftriccloudfrontinvalidationsawsaccesskeyid)

**(optional)** This can be set to the AWS access key ID of your AWS account, if you are not using the default credential provider chain.

### `liftric.cloudfrontinvalidations.awsSecretAccessKey`

[](#liftriccloudfrontinvalidationsawssecretaccesskey)

**(optional)** This can be set to the AWS secret access key of your AWS account, if you are not using the default credential provider chain.

### `liftric.cloudfrontinvalidations.dependantUrlsForPage`

[](#liftriccloudfrontinvalidationsdependanturlsforpage)

**(optional)** This must be a function that returns what URL(s) should be cleared after a page modification.

### `liftric.cloudfrontinvalidations.dependantUrlsForFile`

[](#liftriccloudfrontinvalidationsdependanturlsforfile)

**(optional)** This must be a function that returns what URL(s) should be cleared after a file modification.

### `liftric.cloudfrontinvalidations.dependantUrlsForSite`

[](#liftriccloudfrontinvalidationsdependanturlsforsite)

**(optional)** This must be a function that returns what URL(s) should be cleared after a site modification.

Example config
--------------

[](#example-config)

An some more advanced config, we use a larger `dependantUrlsForPage` function to collect from the old page as well the new page all related pages, considers the `search` page and prepares the urls for both languages, `de` and `en`. Of course this example could be much cleaner and maybe a bit more generic in some circumstances but should only demonstrate a different use case.

In addition to that, we also exclude the `/api` route from caching by sending a custom header which disallows caching. Having done both, we are able to use AWS CloudFront for a larger customer without any problems.

```
