[wp-trac] [WordPress Trac] #36455: Call opcache_reset() after plug-in, theme or core update

WordPress Trac noreply at wordpress.org
Fri May 22 16:42:14 UTC 2020


#36455: Call opcache_reset() after plug-in, theme or core update
-------------------------------------------+---------------------------
 Reporter:  nigro.simone                   |       Owner:  mikeschroder
     Type:  enhancement                    |      Status:  assigned
 Priority:  normal                         |   Milestone:  5.5
Component:  Upgrade/Install                |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  has-patch needs-testing early  |     Focuses:
-------------------------------------------+---------------------------

Comment (by nextendweb):

 In 36455.8.diff:

 Changed the suggested {{{in_array}}} strict param to {{{true}}}

 If a filter is really needed, I'm not sure still the reason why a host
 would want to allow one file to be cleared an not the others. If a plugin
 has a lot of PHP files, it would take a lot of time to run it on each. So
 I propose to add a single filter where you can disallow the clearing of
 the opcache.

 {{{#!php
 <?php
 $opcache_invalidate_allowed = function_exists( 'opcache_invalidate' ) &&
 apply_filters('wp_opcache_invalidate_allowed', true);
 }}}


 > It might also be worth investigating whether a file has actually changed
 before invalidating its cache - I don't know how much of a performance
 impact that would have, but I think in the current patches all files in
 the plugin/theme/core update will be invalidated.

 [https://www.php.net/manual/en/function.opcache-invalidate.php]

 If the second optional parameter left on the default false, then PHP will
 only clear its cache if it changed. So I do not think that we should make
 extra effort to accomplish the same thing.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/36455#comment:71>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list