nswdpc/silverstripe-oldmantium

Reinforced Cloudflare support for Silverstripe websites

Installs: 2 921

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

v1.0.0 2024-05-13 04:43 UTC

This package is auto-updated.

Last update: 2024-10-13 06:54:24 UTC


README

Purge cache handling

Features

  • Versioned DataObject purging, when that DataObject can be represented by one or more URLs
  • Purge hosts, tags, prefixes (for Enterprise Cloudflare accounts)
  • Permissions for administration access to purging
  • Purge all in zone via a queued job

Requirements

See composer.json for specifics.

Installation

composer require nswdpc/silverstripe-oldmantium

License

BSD-3-Clause

See License

Documentation

Configuration

Authentication Token

Documentation: https://developers.cloudflare.com/api/get-started/create-token/

  1. Create Custom Token, give it a name
  2. Zone / Cache Purge / Purge
  3. Include Zone / Specific Zone / < zone >
  4. Client IP Address filtering: restrict access to token
  5. TTL, if required
NSWDPC\Utilities\Cloudflare\CloudflarePurgeService:
  enabled: true
  auth_token: '<auth_token>'
  zone_id: '<zone_id>'
  # Optional, specify a URL to use instead of Director::baseURL()
  base_url: 'https://www.example.com/'

Versioned DataObject

Give a Versioned DataObject the ability to purge from Cloudfront cache

My\Namespaced\Record:
  extensions:
    - 'NSWDPC\Utilities\Cloudflare\DataObjectPurgeable'

When My\Namespaced\Record is published or unpublished, the corresponding URLCachePurgeJob will be created as a queued job.

Maintainers

Add maintainers here or include authors in composer

Bugtracker

Link to the the issue/bug tracker URL

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.