[wp-trac] [WordPress Trac] #36455: Invalidate files in opcode cache after plug-in, theme or core update

WordPress Trac noreply at wordpress.org
Wed Jun 24 00:18:46 UTC 2020


#36455: Invalidate files in opcode cache 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:104 ayeshrajans]:
 > Opcache is per-SAPI. This means even if we clear the opcache for CLI, it
 wouldn't affect other SAPIs like fpm or Apache mod_php.
 >
 > One of the challenges I faced in Composer Preload plugin is warming up
 cache from a different SAPI. I learned that it's not possible to
 populate/clear opcache of fpm/etc from CLI or the other way around. So I
 propose that we don't even need to bother to clear opcache if the update
 is done by CLI (which might make the tests even more complicated).

 That's good to know, thanks! I'm thinking that for a first pass at this,
 it's fine to focus on clearing whatever the current SAPI is. Then, we
 could open another ticket to handle async invalidation, maybe, in the case
 that upgrades happen via the command line, but folks need scripts to be
 invalidated with another SAPI?

 So far, the approach I mentioned seems to be working okay on both the
 command line and otherwise. Hoping to get that testing done today and
 posted.

 I haven't dug more into `update-core.php` and what is best to do there, so
 any knowledge on the workings is appreciated. Currently thinking I *might*
 be able to test it with WP-CLI and creating a custom package to update
 from.

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


More information about the wp-trac mailing list