Add setting that can be overridden to disable API purge for local environments

Created on 5 December 2019, about 5 years ago
Updated 13 September 2024, 3 months ago

It would be very helpful to have a setting in the Fastly module to disable the API purges during normal Drupal tasks for local environments. We've found that having Fastly enabled in a local environment significantly slows down the normal browsing / drush commands on a local site.

With a setting, it could be overridden in a settings.php file per-environment.

Feature request
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇮Finland thatguy

    Re-rolled #16 for 4.x

  • First commit to issue fork.
  • @vvuksan-fastly opened merge request.
  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany simonbaese Berlin

    Used this patch for a while now. It seems like the configuration added in the test does not properly deactivate the diagnostics for the purger plugin. It may has to do with the runtime measurement injection, see comment for the hasRuntimeMeasurement() method.

    When invalidating a lot of tags on a development environment with the purge option disabled, one may run into errors from the QueueSizeDiagnosticCheck. For example:

    Your queue exceeded 100 000 items! This volume is extremely high ...

    I do not know the plugin system for the purgers well, yet. Maybe we could make the return value of the hasRuntimeMeasurement() in the FastlyPurger plugin depend on the configuration.

  • Status changed to Closed: won't fix 10 months ago
  • Hey folks. In the light of that config_split provides support for splitting the configs and managing all aspects of the configuration I will close this issue.

    https://www.drupal.org/project/config_split

  • 🇺🇸United States ksenzee Washington state

    @vvuksan-fastly Could I possibly ask you to reconsider? Most modules have an off switch of some kind that can be controlled via a settings.php file, and config_split isn't that commonly installed. I just checked some statistics, and the most common contrib modules have 300k-600k reported installs, while config_split only has 60k. Our site doesn't use config_split, so we'll now be in the position of installing it just to support this one module (which means a fairly significant adjustment to how all our developers work) or maintaining and running this patch forever. Honestly we'll probably choose the patch route because it's less disruptive.

  • 🇪🇨Ecuador jwilson3

    Raising hand for reconsideration. We'll also be running this patch forever. As stated elsewhere, config_split is not a valid approach because it provides no mechanism to leave the module enabled on local but having the features disabled just through configuration. Puzzlingly enough, for the config_split approach to work, it would actually also need the patch from this issue.

  • 🇺🇸United States bvoynick

    I would also like to see this reopened. Config Split cannot address the issue that uninstalling Fastly & related Purge modules, in an environment lacks the relevant credentials secrets, produces a ton of noisy errors related to inability to purge.

  • 🇺🇦Ukraine khiminrm

    +1 to have this feature without installing config_split

  • 🇺🇸United States azinck

    Here's another vote for reconsidering this decision. I agree with the points made above. Config_split is a very non-optimal way to solve this problem.

  • 🇺🇦Ukraine Anna D

    Re-rolled #16 for 4.3

  • 🇦🇺Australia thomwilhelm Sydney

    Also +1 for adding this. Much easier to have code like this rather than having to set up a config split.

    // Disable Fastly purging by default.
    $config['fastly.settings']['purge'] = FALSE;
    if (is_production()) {
        // Enable purging on production.
        $config['fastly.settings']['purge'] = TRUE;
    }
    
Production build 0.71.5 2024