koala-framework / kwf-aws-cdn
Deliver web assets using amazon cloudfront.
Installs: 1 947
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- aws/aws-sdk-php: ^2.8.31
- koala-framework/koala-framework: ~4.2 || ~5.0
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]
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.