Problem/Motivation
Multiple highly experienced developers/sitebuilders have stumbled on the lack of a feature flag style ability to disable all purge activity.
Steps to reproduce
- Enable and configure a purger module.
- Start to worry if actions on development and test sites will purge live caches.
Proposed resolution
The current solution seems to be for individual purger modules/plugins to take on this work, leading to uncertainty with whether the environment is taken into account even when it is, risk of the environment not being taken into account, and lack of control over when and where purging should be active.
Instead, disabling purging should be a Purge-wide configuration setting that can be toggled by site administrators and easily overridden per environment (local, test).
Remaining tasks
Decide on an approach, do it, document it.
User interface changes
Ideally there would be a place in the UI where the feature flag of purging can be turned off, and this is the setting that developers can override per-environment.
API changes
Data model changes
Original request
It seems the module trying to purge the addresses from reverse proxy, even the node is saved as new. This is problematic especially on some migration processes which significantly slowing the process where there is no need for purge.
Is there any option to temporary disable purge functionality (without disabling the module it-self)?
I've tried to remove variable 'purge_proxy_urls', but it's using localhost instead (which is still trying to purge the URLs), despite there is no reverse proxy at localhost and it's only makes the things worse, as it's generates long timeouts.
Any solution to that?
Issue fork purge-2551317
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joseph.olstadI'd like to also be able to easily disable it for when I'm working in dev environments and I for some reason need to turn some things off temporarily.
Comment #3
dave reidI would also like to see a way to do this. Maybe a Settings flag somehow?
Comment #4
dave reidI tried using this in my
settings.local.php:But then I get this error with all my Drush commands:
Comment #5
jwilson3It would be exceedingly helpful to have a feature flag style killswitch to disable purger diagnostics that piggyback on most Drush commands.
Comment #6
mlncn commentedCame to the queue looking for documentation and did not expect to find this as an open feature request! Updating the issue summary.
One solution may be a "Dev" or "Null" purger that could be configured the way dave reid tried, except of course it would be an actual purger and so would work. This purger could have its own development logging settings so it could be seen in detail what Purge is doing on development environments and when actively testing, and simply disable purging on environments that do not have a reverse proxy or CDN.
(Note to self probably the max cache age should be overridden at the same time.)
Currently my need is for Cloudflare if anybody knows if that module's Cloudflarepurger will figure out not attempt to purge caches when the domain does not match the configuration in Cloudflare. (Though i will note we are going with Purge module precisely so that switching away from Cloudflare will be easy.)
Comment #7
mlncn commentedCloudflare purger does indeed send purge commands to the live environment based on page edits etc that happen in development, as feared.
Making a null/logging purger, will contribute it as a contrib module, going easier than expected (though i'm not sure why i thought a purger that does nothing would be hard lol)
Comment #9
mlncn commentedEven with a dummy purger like this new one, overriding the configured purger is impractical without a concept of disabling purgers— hence the merge request. (The goal is to have the minimal change in config between environments, and both
purge.logger_channels.ymlandpurge.plugins.ymlwould have multiline changes that are in sequences without defined keys— no idea how to oven override that, and if it is possible, it would be way too tweaky for production work.With this merge request, extremely simple for now, you could enable purgers meant for both live and dev/test and do:
In your local settings.php:
And with Null Purger you could in your live settings.php:
Major caveat: This hides the disabled purger plugin from
/admin/config/development/performance/purgeand adding a new one while one is disabled will remove the disabled one's configuration.So more work is needed, purger plugins need a concept of being disabled so their configuration can stay while they are conditionally (temporarily, for different environments) turned off.
Comment #10
mlncn commentedLooks like https://www.drupal.org/project/purge_control might also be pressed into service to enable/disable purging per environment, possibly? Albeit without any logging.