Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Trash 3.0.33 Minor update available for module trash (3.0.33). EOL Warning: Drupal 11.0 has reached end of life and no longer receives security updates. Usage Milestone: Focal Point Module focal_point crossed 1,000 active installs. Release: UI Patterns (SDC in Drupal UI) 2.0.20 Minor update available for module ui_patterns (2.0.20). Release: Trash 3.1.0-rc1 First release candidate for module trash (3.1.0-rc1). Release: Country 2.2.0 Minor update available for module country (2.2.0). Usage Milestone: Ultimate Cron Module ultimate_cron crossed 1,000 active installs. Usage Milestone: Easy Breadcrumb Module easy_breadcrumb crossed 1,000 active installs. Usage Milestone: Config Filter Module config_filter crossed 1,000 active installs. Usage Milestone: Blog Module blog crossed 1,000 active installs.

Cache Utility

298 sites Security covered Drupal 10–11
View on drupal.org

This module provides a user interface, Drush commands, and cURL commands to flush various caches, including PHP OPCache, APCu, and Drupal's database caches. It also offers features like truncating the cachetags table to prevent database growth and allows flushing PHP OPCache via Drush, which is typically not possible.

Cache Utility module provides an ability to view status and flush various caches in three ways:

  • Web browser user interface
  • Curl commands
  • Drush commands

The following caches are supported:

  • PHP OPCache
  • PHP APCu extension cache
  • Database cache_* tables
  • Database cachetags table
  • Clear Drupal cache via Curl

Other features

  • The module may also be configured to flush any of the above caches along with Drupal’s cache flush.
  • An optional sub-module adds links for flushing above caches under the "Drupal icon > Flush all Caches" via the contributed Admin Toolbar Extras module.

Benefits

  1. The Curl commands provide convenience of flushing various caches externally from the webserver. A single long secret code may be set to manage cache flushing on multiple sites.
  2. PHP OPCache, and APCu caches can be flushed without server restarts or adding obfuscated php files to the webserver.
  3. Enables flushing of PHP OPCache via drush which is normally not possible as drush executes using PHP-CLI and not the PHP used by webserver.
  4. Provides an ability to truncate cachetags database table which is not managed by Drupal core and in certain cases can have unlimited growth which drastically increases database size that may start to affect performance. See Drupal core issue # 3097393
  5. Provides an ability to truncate cache_* database tables.

Known issue

Truncating cache_* table for sqlite database does not work, due to unresolved Drupal core issue # 2949229

Configuration and Usage report Screenshot


Drush and Curl Commands

Documentation for the curl and drush command for each cache type is included on the module's configuration page at Configuration > Development > Cache Utility
Or at this path /admin/config/development/cache_utility

Sample commands

###############################################################################
# PHP OPCache
###############################################################################
Clear OPCache
Drush:   drush cu:opcache-clear --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/opcache/clear
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/opcache/clear

Get OPCache config
Drush:   drush cu:opcache-config --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/opcache/config
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/opcache/config

Get OPCache status
Drush:   drush cu:opcache-status --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/opcache/status
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/opcache/status

###############################################################################
# PHP APCu cache
###############################################################################
Clear APCu
Drush:   drush cu:apcu-clear --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/apcu/clear
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/apcu/clear

Get APCu config
Drush:   drush cu:apcu-config --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/apcu/config
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/apcu/config

Get APCu status
Drush:   drush cu:apcu-status --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/apcu/status
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/apcu/status

###############################################################################
# Database Cachetags table
###############################################################################
# View the status of database cachetags table
Drush:   drush cu:cachetags-status --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/cachetags/status
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/cachetags/status

# Truncate database cachetags table
Drush:   drush cu:cachetags-truncate --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/cachetags/clear
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/cachetags/clear

###############################################################################
# Database cache_* tables
###############################################################################
# View the status of database cache_* tables
Drush:   drush cu:cachetables-status --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/drupalcache/status
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/drupalcache/status

# Truncate all database cache_* tables
Drush:   drush cu:cachetables-truncate --host https://example.com
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/drupalcachetables/clear
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/drupalcachetables/clear

# Clear Drupal's cache
Drush:   drush cr
Curl (site host):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' https://example.com/admin/cache_utility/drupalcache/clear
Curl (localhost):   curl -H 'Content-Type: application/json' -H 'CU-ACCESS-KEY: LONG_SECRET_KEY' http://localhost/admin/cache_utility/drupalcache/clear

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Feb 2025
Latest release
1 month ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.4.1 Stable 10–11 Jul 23, 2026
1.4.0 Stable 10–11 Jul 14, 2026
1.3.0 Stable 9–10 Feb 18, 2025
1.2.1 Stable 9–10 Feb 18, 2025