• Resolved esszach

    (@esszach)


    Hello,

    I am running a WordPress Multisite with W3 Total Cache, and have been running into performance issues due to W3’s clearing of OPcache.

    I’m finding that OPcache is flushed every time I publish or update a page, an unnecessary action which is having a significant impact on my site’s performance. I would like to disable this automatic flushing of OPcache – or at the very least reduce the frequency at which it is flushed.

    So far I have had success eliminating the OPcache flush while preserving the flush of the other caches by making the following adjustment to SystemOpCache_Core.php:

    
    public function flush() {
                    if ( Util_Installed::opcache() ) {
                            return opcache_reset();
                    } else if ( Util_Installed::apc_opcache() ) {
                                    $result = apc_clear_cache();   // that doesnt clear user cache
                                    $result |= apc_clear_cache( 'opcode' );   // extra
                                    return $result;
                            }
                    return false;
            }
    

    to:

    
    public function flush() {
                    return false;
                    if ( Util_Installed::opcache() ) {
                            return opcache_reset();
                    } else if ( Util_Installed::apc_opcache() ) {
                                    $result = apc_clear_cache();   // that doesnt clear user cache
                                    $result |= apc_clear_cache( 'opcode' );   // extra
                                    return $result;
                            }
                    return false;
            }
    

    Naturally I would prefer a solution that does not require modifying the plugin’s code. Is there a configuration that I can apply to W3TC or my php.ini which would eliminate the automated OPcache flush within W3TC?

    • This topic was modified 3 years, 6 months ago by esszach.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @esszach

    Thank you for reaching out and I am happy to assist you with this.
    Let me check this and make some tests and I’ll get back to you once I have more information.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @esszach

    Thank you for yoru patience.
    We’ve confirmed this and I’ve opened a GitHub issue on your behalf in our repository.
    Please make sure to track the progress of the ticket regularly and feel free to add any comments.

    Thank you for bringing this to our attention.

    Thread Starter esszach

    (@esszach)

    Hi Marko,

    Thank you for looking into this and creating the ticket. I appreciate it!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disable OPcache within W3TC’ is closed to new replies.