Skip to content

Reinforced Cloudflare cache purging support for Silverstripe websites

License

Notifications You must be signed in to change notification settings

nswdpc/silverstripe-oldmantium

Cloudflare purge support for Silverstripe websites

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 Cloudflare 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.

About

Reinforced Cloudflare cache purging support for Silverstripe websites

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages