Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USAGOV-2038-tome-cache-page #2040

Merged
merged 8 commits into from
Nov 13, 2024
12 changes: 11 additions & 1 deletion web/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,17 @@
}
}

// Overide anything special for local developement
// Add cache.backend.null:
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/nonlocal.services.yml';

if (PHP_SAPI === 'cli' && str_starts_with($_SERVER["argv"][1], 'tome:static')) {
// Disable the page and menu cache on tome runs
$settings['cache']['bins']['page'] = 'cache.backend.null';
$settings['cache']['bins']['menu'] = 'cache.backend.null';
$settings['cache']['bins']['data'] = 'cache.backend.null';
}

// Override anything special for local development
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
5 changes: 5 additions & 0 deletions web/sites/nonlocal.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# For non-local environments. We want to be the cache.backend.null there too.
#
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
Loading