Download the PHP package jean-beru/fos-http-cache-cloudfront without Composer
On this page you can find all versions of the php package jean-beru/fos-http-cache-cloudfront. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jean-beru/fos-http-cache-cloudfront
More information about jean-beru/fos-http-cache-cloudfront
Files in jean-beru/fos-http-cache-cloudfront
Package fos-http-cache-cloudfront
Short Description Tools to manage CloudFront HTTP caching proxy with PHP
License MIT
Informations about the package fos-http-cache-cloudfront
CloudFront implementation of FOSHttpCache
This library provides an implementation of FOSHttpCache for CloudFront.
Usage
Initialize dependency
First, create an instance of AsyncAws\CloudFront\CloudFrontClient
to allow the proxy to make requests.
See aws-sdk-php documentation
for more information.
Create the CloudFront proxy
To instantiate the proxy, pass the CloudFront client and the AWS CloudFront distribution ID.
Invalidate URLs
To invalidate /homepage
URL and all URLs matching the /assets/*
pattern on the "XYZ1234657" distribution.
Avoid request duplication
CloudFront APIs asks for a "caller reference" to avoid duplicated requests. By default, this library use the UniqIdCallerReferenceGenerator to generate a unique identifier.
You can use other generators present in the CallerReference folder or implement your own by implementing the CallerReferenceGenerator interface.
For instance, if you want to avoid duplicate calls in the same minute:
If a duplication is detected by AWS, a FOS\HttpCache\Exception\ProxyResponseException
will be thrown.
Resources
All versions of fos-http-cache-cloudfront with dependencies
async-aws/cloud-front Version ^0.1.3 || ^1.0
friendsofsymfony/http-cache Version ^2.15 || ^3.0