Add disable option and confirm option as safeguards

Created on 7 October 2024, 2 months ago

Problem/Motivation

If this module is enabled on a non-production environment (e.g. database duplicated on dev machine), the production cloudflare zone can be purged from that machine. There should be a way to disable these actions on such machines.

Also, the Purge Cloudflare Cache menu item is added where the Flush all caches option is normally located. This is a high impact operation on production sites that can be accidentally selected. There should be an option to display a confirmation form.

Steps to reproduce

Duplicate the database on a local dev environment and select the Purge Cloudflare Cache option.

Proposed resolution

Add a Disable Cloudflare Cache option that removes/disables the full cache clears and node cache clears.

Allow this to be set in the settings.config file via the line:

$setting['disable_cloudflare_purge'] = TRUE;

This can be wrapped in the standard logic to apply to non-production environments. E.g. local settings files.

Add a configuration option to request confirmation before clearing the entire cache. If set, using the menu option will show a confirmation form. If confirmed, the cache will be cleared and the user brought back to the same page.

Remaining tasks

None except review of the supplied patch.

User interface changes

Adds two new options.

Add optional confirmation form.

API changes

None

Data model changes

Settings override for disable option.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cgmonroe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024