"Clear all caches" should also reset OpCache

Created on 11 November 2019, over 4 years ago
Updated 4 March 2024, 4 months ago

When using the UI to "clear all caches" the zend opcode cache should be cleared also.

I use git pull to deploy to production. Unfortunately sometimes, some dependencies run into error conditions. Reason is, that my opcache.revalidate_freq is 60 seconds.

I suggest to do an opcache_reset() in the "clear all caches" procedure to have that cache cleared, too.

I suggest to do an opcache_reset() ind drush cr, also. (But I never had that sync bug with drush)

I use Drupal 8.7 on CentOs 7.6 with

[proxiss@marge ~]$ php -v
PHP 7.2.20 (cli) (built: Jul  2 2019 13:37:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies
✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
CacheΒ  β†’

Last updated about 19 hours ago

Created by

πŸ‡©πŸ‡ͺGermany proxiss

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.

  • πŸ‡§πŸ‡ͺBelgium kriboogh

    I think you could just add it to the /core/rebuild.php file, and do a curl call to that instead.
    So, modify rebuild.php like so:

      // Clear user cache for all major platforms.
      $user_caches = [
        'apcu_clear_cache',
        'wincache_ucache_clear',
      ];
    

    Should become:

      // Clear user cache for all major platforms.
      $user_caches = [
        'apcu_clear_cache',
        'wincache_ucache_clear',
        'opcache_reset',
        'apcu_clear_cache',
      ];
    

    Then drush cr can do a call to /rebuild.php.

Production build 0.69.0 2024