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

WordPress Trac noreply at wordpress.org
Fri May 22 15:03:56 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 jnylen0):

 Replying to [comment:67 nextendweb]:
 > I proprose 36455.7.diff:
 `in_array` should set the optional third parameter to `true` to use a
 strict comparison.

 > the filter in the previous patch is not necessary in my opinion.
 I recommend keeping the filter. It is mainly intended for hosting
 providers that want to override this logic for whatever reason, without
 fully disabling the opcache APIs. WordPress.com is an example of a
 provider that might want to do this. Also, just in general, more
 flexibility is better than less.

 > BTW: I'm thinking about that maybe it would be better to call
 {{{opcache_invalidate()}}} on the deleted PHP files also before the
 deletion. Maybe that would be a more safe way of clearing the opcache.
 Seems worth investigating.

 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.

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


More information about the wp-trac mailing list