Download the PHP package justbetter/statamic-cloudflare-purge without Composer

On this page you can find all versions of the php package justbetter/statamic-cloudflare-purge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-cloudflare-purge

Statamic Cloudflare Purge

This addon will hook into your already existing statamic invalidation and purge any pages that have been invalidated from your Cloudflare cache.

Requirements

Installation

Usage

You need a Cloudflare API key with the Zone.Cache Purge permission, and set it in your .env:

You will also have to define the zone of your website:

Finally, enable the package:

If you have a multistore setup with multiple zones, see the Configuration section.

This package listens to the UrlInvalidated event and adds every invalidated URL to a temp file. It also listens to certain events as defined in the config file to flush the whole cache.

Then, when you run the statamic:cloudflare:purge command or the PurgeCloudflareCachesJob job, these files will get purged from the Cloudflare cache. As such, you should add this to your routes/console.php like so:

[!NOTE] Be aware of the rate limits on the API. You're probably not going to run into any issues, but it's possible. Especially if you end up calling an everything-purge often and you're on a free plan, or have a lot of sites running on the same Cloudflare account.

Configuration

You can publish the config with the following command:

Multiple zones

Using the configuration file you can define multiple zones. There are 3 ways of defining the zone in your config:

Cache flushing

You can define any events that will trigger a full cache purge immediately in the config file. By default, these three events have been defined for this purpose:


All versions of statamic-cloudflare-purge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
statamic/cms Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package justbetter/statamic-cloudflare-purge contains the following files

Loading the files please wait ...