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

WordPress Trac noreply at wordpress.org
Tue Jun 16 05:40:29 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 mikeschroder):

 Replying to [comment:85 nextendweb]:
 > @mikeschroder I think there is a missing () in your code. Checks for the
 opcache.restrict_api should be wrapped as {{{0 && 0 || 1}}} evaluates to
 true even when {{{opcache_invalidate}}} is not available.

 Good catch. Thanks! I'll fix this.

 > Also I still do not see any reason to run
 {{{wp_opcache_invalidate_file}}} filter on every file. Could you give any
 when you do not want to invalidate a single file or a list of files in the
 opcache?

 Sure. This is in here to allow hosts or plugins to override the behavior.
 This might be important if a plugin can handle its own purging better than
 core knows, or for hosts and caching plugins that have custom handling.
 I'm not positive this is the best way to allow for it, and it's possible
 the filter would be better elsewhere. Caching implementations can be
 pretty different, and this allows for the previous behavior when this
 comes up.

 On another note:
 I'm working on some of the docs, too, for the next patch. In the previous
 patch I left `$force` as the name of the variable because it matches with
 `opcache_invalidate()`. I'm wondering if something like
 `$skip_timestamp_validation` might be better, since invalidation is not
 forced (if it is unavailable, for instance)?

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


More information about the wp-trac mailing list