diff --git a/README.md b/README.md index ef7e1db..6e36f95 100755 --- a/README.md +++ b/README.md @@ -5,25 +5,24 @@ This TYPO3 extension is a flexible and generic way to track the pages that are c nginx or varnish, or any useful CDN. Currently supported backends / providers: - * Cloudflare CDN - * Fastly CDN - * Varnish via curl - * plain curl + * Cloudflare CDN (https://packagist.org/packages/b13/cloudflare-cdn) + * Akamai CDN (https://packagist.org/packages/b13/akamai) + * Azure CDN (https://packagist.org/packages/b13/azure-purge) What does it do? ---------------- By embracing TYPO3's Caching Framework this extension provides a new cache to track all pages outputted that are "cacheable". When an editor changes content on a page, the page cache needs to be cleared - and the CDN / reverse proxy -needs to be informed that the cache is invalid. This is usually done via a HTTP PURGE request to the CDN / proxy server. +needs to be informed that the cache is invalid. This is usually done via a HTTP PURGE request to the CDN / proxy server +or a custom API. The benefits for that are that the editor does not need to worry why out-of-date information is still visible on his/her website. Requirements ------------ - * A TYPO3 setup (v9 LTS+) with cacheable content, see the "cacheinfo" extension for what can be tracked with HTTP caches. - * Either nginx or varnish configured to proxy the TYPO3 system. For nginx, make sure that nginx is compiled to allow - to flush caches via HTTP `PURGE`. Alternatively, use a CDN like Fastly or Cloudflare for playing around with it. + * A TYPO3 setup (v11 LTS+) with cacheable content, see the "cacheinfo" extension for what can be tracked with HTTP caches. + * A CDN or Reverse Proxy (such as nginx or apache2) Setup ----- @@ -36,27 +35,7 @@ Whenever a cacheable frontend page is now called, the full URL is stored in a ca table is emptied completely, additionally, a HTTP PURGE call to the reverse proxy is made to empty all caches. If only a certain tag is removed, the PURGE call is made only to the relevant URLs that are stored in the cache. -### Fastly - -Fastly makes a direct HTTP PURGE call to a specific URL, so it needs to be ensured that the request comes directly -from the production environment (CDN backend server) where access to fastly is allowed, and PURGE requests are accepted. - -Ensure to set the environment variables `FASTLY_SERVICE_ID` and `FASTLY_API_TOKEN`. - -### Cloudflare - -Cloudflare v4 API is used to make HTTP requests via Guzzle HTTP and API Tokens. This is done by firing HTTP POST -requests to purge one, multiple or all requests on a domain. - -Ensure to set the environment variable `CLOUDFLARE_API_TOKEN` in place. - -#### Configuration - -Add this to your `AdditionalConfiguration.php` file: - - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['proxycachemanager']['cloudflare']['zones'] = [ - 'example.com' => 'MY_ZONE_ID' - ]; +### Configuration By default all administrators can flush the CDN caches via the toolbar on the top right corner of TYPO3's Backend. @@ -70,12 +49,9 @@ UserTsConfig option: `options.clearCache.proxy = 0` -#### Limitations - - Only API Token authentication is available - - It is not possible to flush by tag (Enterprise Only) - Credits ------- + The extension was created taken all the great from Andreas Gellhaus, Tom RĂ¼ther into account, as well as `moc_varnish` and `cacheinfo` as great work before. diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000..50202b8 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,38 @@ +# Upgrade Instructions + +v3 => v4 + +Proxycachemanager v3 served for many years as a well thought out basis +for extending the interface for any kind of proxy and CDN adapter. + +However, some functionality has been removed and adapted, +here is a list of features that have been removed or changed: + +## Removed Functionality + +* Cloudflare CDN Cache Provider +* Curl HTTP Cache Provider +* Fastly CDN Cache Provider +* Varnish HTTP Cache Provider + +These features can be added in separate extensions requiring +proxycachemanager, and utilizing even more functionality. + +In case you need them, we suggest moving the code from "proxycachemanager" +v3 into your extension code, and then adapt to the updated +interface. + +## Adapted "ProxyProviderInterface" + +The main interface "ProxyProviderInterface" has the following methods removed: + +* "setProxyEndpoints" - Not every Cache Provider ships an endpoint, so this can be handled individually +* "flushCacheForUrl($url)" - Use "flushCacheForUrls(array $urls): void" instead + +New methods have been introduced: +* "isActive(): bool" to define if a Proxy Cache Provider has been set up properly +* "shouldRequestBeMarkedAsCached(RequestInterface $request): bool" allows to define whether a frontend page is behind a reverse proxy and should be added to the cache + +In addition, the interface is now fully typed. + +The TYPO3 Extension now required PHP 8.1 and TYPO3 v11 LTS. \ No newline at end of file