CloudFlare API Integration Icon

CloudFlare API Integration

Save resource and clear MODX cache now clear CloudFlare cache.

By Dash Media (dashmedia)

CloudFlare API Integration first screenshot

Go to System Settings and update the following:

cloudflare.api_key = your CloudFlare api key, this is visible on the Account tab of CloudFlare https://www.cloudflare.com/my-account

cloudflare.email_address = The email address associated with the account (the one you use to log in to CloudFlare)

Optional context/system settings

cloudflare.skip = 1; ignore this context when clearing global cache

cloudflare.use_dev = 1; enable CloudFlare Development mode when clearing the global cache

Please note that PurgeCloudFlare relies on your http_host setting to tell CloudFlare which domain/account to clear files from, if you're using multiple contexts they will each need this setting.

Ignoring a context: if you do not wish PurgeCloudFlare to attempt to clear the CloudFlare cache for a specific context, add a context setting named 'cloudflare.skip' and set its value to 1

Once you have done this, MODX will clear your CloudFlare Cache every time the system-wide cache is cleared, and will clear individual pages when they are saved from the MODX manager

Saving a page will also clear the parents of the saved page (not doing this was confusing many of our clients, so I'd assume you were having similar issues with your own)

Installation Instructions

Install via Package Manager, or grab the static files from our GitHub Repo feel free to report bugs

Dash Media

Support


New in CloudFlare API Integration 2.1.1

==2.1.1pl==

- Fix for php 5.3.x (Thanks to @getandyjones)

==2.1.0pl==

- Upgrade to CloudFlare API V4 (Thanks to @friimaind)

==2.0.2pl==

- Fix for clearing single files clearing when domain starts with 'www'

==2.0.1pl==

- Fix for domains starting with 'www'

- Allow usedev to be set in system settings or context settings

==2.0.0pl2==

- enable dev mode now defaults to 0, set context or system setting to 1 to enable

==2.0.0pl==

- WARNING: Updated system and context setting names

- Migrate to repoman for package creation

=1.2.3pl==

- Fix error caused by browser plugin which changed the urls being referenced for the api

==1.2.2pl==

- Fix the enable dev mode flag

==1.2.1pl==

- All parents of saved document also purged from cloudflare cache on save

==1.2.0pl==

- Clearing site cache will now activate development mode for the domain

- Add cfuse_dev context option

==1.1.1pl==

- Removed system settings from namespace as ThemePackagerComponent doesn't seem to fully-support them yet, this was preventing people from saving the system settings until they were moved into another namespace

==1.1.0pl==

- PugeSingeFile added, PurgeCloudFlare will now clear individual pages from the CloudFlare cache when they are saved from the manager (Yep, how cool is that)

- Added support for multiple contexts

==1.0-rc1==

- Inital Commit

More

Information

Released
January 11, 2017
Supported Versions
2.2 – Current
Downloads
3,575
License
unlicense.org

More from Dash Media

googleMap

Output modifier turns an address into a Google Maps static map.

View
recursiveGrab

Snippet returns the value of a TV, recursively returning values from…

View
srcset

Creates @1x and @2x images using srcset html attribute.

View
GetIdList

Snippet returns a list of resource ids. A fork of GetIds.

View