koala-framework/kwf-aws-cdn

Deliver web assets using amazon cloudfront.

1.0.x-dev 2020-12-10 09:42 UTC

This package is auto-updated.

Last update: 2024-11-10 18:24:58 UTC


README

Adds support for caching asset and media urls thru a cdn instance on amazon cloudfront.

Configuration

For single domain

;bind kwf events
eventSubscribers.awscdn = KwfAwsCdn_Events
;bind clear cache
clearCacheTypes.assetsAwsCdn = KwfAwsCdn_ClearCacheTypeAssets
; individual cdn config
awscdn.access_key_id = [YOUR-AWS-KEY]
awscdn.secret_access_key_id = [YOUR-AWS-SECRET_KEY]
awscdn.distribution_id = [YOUR-CDN-DISTRIBUTION-ID]
awscdn.domain = [YOUR-CDN-WEB-DOMAIN]

For multi domain

;bind kwf events
eventSubscribers.awscdn = KwfAwsCdn_Events
;bind clear cache
clearCacheTypes.assetsAwsCdn = KwfAwsCdn_ClearCacheTypeAssets
; individual cdn config
awscdn.access_key_id = [YOUR-AWS-KEY]
awscdn.secret_access_key_id = [YOUR-AWS-SECRET_KEY]
kwc.domains.my.awscdn.distribution_id = [YOUR-CDN-DISTRIBUTION-ID]
kwc.domains.my.awscdn.domain = [YOUR-CDN-WEB-DOMAIN]

more info on credentials

Compatibility

Does not work in combination with https://github.com/koala-framework/kwf-varnish . Kwf-Varnish has the same purpose as this package but uses a different strategy. Be sure to turn varnish off:

For single domain

varnish.domain = false

For multi domain

kwc.domains.hu.varnish.domain = false

Test enviromnent

Kwf Prelogin must be disabled. Otherwise Amazon Cloudfront cannot properly cache the site.

References

Relevant Docu for aws-php sdk version 2

Invalidate cache

Path Syntax for invalidation API

Configure sdk

Doku