All Projects → steadlane → silverstripe-cloudflare

steadlane / silverstripe-cloudflare

Licence: BSD-3-Clause license
This module aims to relieve the stress of using CloudFlare caching with any SilverStripe project. Adds extension hooks that clears CloudFlares cache for a specific page when that page is published or unpublished

Programming Languages

PHP
23972 projects - #3 most used programming language
scheme
763 projects
CSS
56736 projects

Projects that are alternatives of or similar to silverstripe-cloudflare

warpy
A command-line program to get WARP+ as WireGuard written in python
Stars: ✭ 57 (+147.83%)
Mutual labels:  cloudflare
ddos-prot-mc-servers
DDoS Protection for your minecraft server!
Stars: ✭ 36 (+56.52%)
Mutual labels:  cloudflare
miniflare
🔥 Fully-local simulator for Cloudflare Workers
Stars: ✭ 2,811 (+12121.74%)
Mutual labels:  cloudflare
php-proxy
php proxy based on GoAgent protocal,Implemented by golang
Stars: ✭ 85 (+269.57%)
Mutual labels:  cloudflare
carrierwave-cloudflare
🎑 This Rails gem integrates Carrierwave with Cloudflare Image Resizing
Stars: ✭ 24 (+4.35%)
Mutual labels:  cloudflare
terraform-cloudflare-maintenance
Terraform module to create a responsive Maintenance Page using Cloudflare Workers.
Stars: ✭ 111 (+382.61%)
Mutual labels:  cloudflare
nebula
Source Code for the Home Server setup.
Stars: ✭ 48 (+108.7%)
Mutual labels:  cloudflare
cloudflare-dns-action
A GitHub action to set a DNS record using Cloudflare on push to the master branch.
Stars: ✭ 41 (+78.26%)
Mutual labels:  cloudflare
cloudflare
Bypass Cloudflare's anti-bot page
Stars: ✭ 15 (-34.78%)
Mutual labels:  cloudflare
workers-jwt
Generate JWTs on Cloudflare Workers using the WebCrypto API
Stars: ✭ 67 (+191.3%)
Mutual labels:  cloudflare
worker-auth-providers
worker-auth-providers is an open-source providers to make authentication easy with workers. Very lightweight script which doesn't need a lot of dependencies. Plug it with any framework or template of workers.
Stars: ✭ 85 (+269.57%)
Mutual labels:  cloudflare
cloudflare-worker-routing
A simple Cloudflare Worker with built-in routing
Stars: ✭ 38 (+65.22%)
Mutual labels:  cloudflare
crisp-react
React boilerplate written in TypeScript with a variety of Jamstack and full stack deployments. Comes with SSR and without need to learn a framework. Helps to split a monolithic React app into multiple SPAs and avoid vendor lock-in.
Stars: ✭ 147 (+539.13%)
Mutual labels:  cloudflare
cfw-easy-utils
An in-depth library to assist with common tasks with CF Workers. Includes utils for responses, cookies, and more!
Stars: ✭ 52 (+126.09%)
Mutual labels:  cloudflare
vite-plugin-cloudflare
🔥Building Cloudflare workers is faster and easier using vite-plugin-cloudflare with node builtins like process and stream
Stars: ✭ 108 (+369.57%)
Mutual labels:  cloudflare
server-ip-addresses
Daily updated list of IP addresses / CIDR blocks used by data centers, cloud service providers, servers, etc.
Stars: ✭ 74 (+221.74%)
Mutual labels:  cloudflare
silverstripe-base
A base module for my SilverStripe projects
Stars: ✭ 17 (-26.09%)
Mutual labels:  silverstripe
Silverstripe-SEO
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content
Stars: ✭ 41 (+78.26%)
Mutual labels:  silverstripe
polynimbus
Multi-cloud infrastructure inventory and management tool, supporting AWS, Google Cloud, Azure, Oracle Cloud, Rackspace Cloud, Hetzner Cloud, Alibaba Cloud, e24cloud.com, Linode, Cloudflare, GoDaddy and Backblaze B2.
Stars: ✭ 70 (+204.35%)
Mutual labels:  cloudflare
worker-kv
Rust bindings to Cloudflare Worker KV Stores
Stars: ✭ 36 (+56.52%)
Mutual labels:  cloudflare

silverstripe-cloudflare

Build Status Latest Stable Version Total Downloads License Monthly Downloads Code Climate

Introduction

The intention of this module is to relieve the double-handling required when updating any of your pages within the CMS of SilverStripe while being behind Cloudflare. When a page is Published or Unpublished a call will be made to the relevant Cloudflare endpoint to clear the cache of the URL/Page you just published/unpublished.

This allows you to see your changes instantly in the preview window without having to worry about logging into the Cloud Flare dashboard to purge the cache yourself.

Cloudflare allows you to have multiple domains registered under a single account. This module is versatile in the sense that it will automatically detect which Zone ID is to be used alongside the domain that this module is installed on. Therefore beyond the two configuration settings required below there is no additional setup required. You can "plug and play" this module in as many locations as you want which means you don't have to worry about tracking down the relevant Zone ID (you can only get it via the API).

Remember: Always keep your API authentication details secure. If you are concerned with your credentials being on someone else's machine; have them set up their own Cloudflare account.

Note: The detected Zone ID will always be shown in the SilverStripe Administration panel whilst viewing the "Cloudflare" menu item

Features

  • Dynamic Zone ID Detection
  • Intelligent Purging
    • If you modify the title or URL of any page: All cache for the zone will be purged.
    • If you modify the contents of any page: Only the cache for that page will be purged.
    • If you modify any page that has a parent, the page you modified and all of it's parents will be purged too.
  • Manual Purging
    • The administration area for this module allows you to either purge all css files, all javascript files, all image files or ... everything.

Installation

This module only supports installation via composer:

composer require steadlane/silverstripe-cloudflare

Run /dev/build afterwards and ?flush=1 for good measure for SilverStripe to become aware of this module

Configuration

Configuration for this module is minimal, you need only define two constants in mysite/_config.php

define('CLOUDFLARE_AUTH_EMAIL', '[email protected]');
define('CLOUDFLARE_AUTH_KEY', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');

Or alternatively, define environment variables in .env

CLOUDFLARE_AUTH_EMAIL="[email protected]"
CLOUDFLARE_AUTH_KEY="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Cache Rules

It is recommended that you add the below to your Cloudflare Cache Rules as no-cache

Rule Comments
example.com.au/*stage=Stage* It is outside the scope of this module to handle cache purging for drafts. Drafts should never need to be cached as they're not usable on the front end
example.com.au/Security/* Prevents caching of the login page etc
example.com.au/admin/* Prevents caching of the Administrator Panel
example.com.au/dev/* Prevents caching of the development tools

Bypass Cache Example

Contributing

If you feel you can improve this module in any way, shape or form please do not hesitate to submit a PR for review.

Troubleshooting and FAQ

Q. The SS Cloudflare administrator section is blank! A. If the Cloudflare administration panel isn't loading correctly, a quick ?flush=1 will resolve this issue.

Q. The SS Cloudflare footer always says "Zone ID: UNABLE TO DETECT". A. This module dynamically retrieves your Zone ID by using the domain you have accessed the website with. Ensure this domain is correctly registered under your Cloudflare account. If the issue persists, please open a ticket in our issue tracker and provide as much information you can.

Bugs / Issues

To report a bug or an issue please use our issue tracker.

License

This module is distributed under the BSD-3 Clause license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].