[wp-trac] [WordPress Trac] #57789: Make theme.json related caches persistent

WordPress Trac noreply at wordpress.org
Thu Feb 23 08:07:42 UTC 2023


#57789: Make theme.json related caches persistent
-------------------------+--------------------------
 Reporter:  flixos90     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  6.3
Component:  Themes       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  performance
-------------------------+--------------------------

Comment (by oandregal):

 It's worth noting that these caches were implemented as persistent in
 Gutenberg, and they were removed to unblock this work from landing into
 core. See https://github.com/WordPress/gutenberg/pull/46150 for details,
 and links to the conversations. The PR can also serve to bring everything
 back quickly.

 The cache invalidation covered all the following scenarios:

 - `upgrader_process_complete`: for WordPress, plugin, and theme updates.
 - `switch_theme`: the active theme is changed.
 - `start_previewing_theme`: previews for customizer and theme directory.
 - `save_post_wp_global_styles`: user updates theme.json data via the site
 editor.
 - `activated_plugin` and `deactivated_plugin`: any plugin can hook into
 the existing `theme.json` filters, so when they are activated/deactivated
 the filters may change.

 The disagreement was specific to the following two points:

 - Consumers that hook into `theme.json` data using dynamic mechanisms
 (deciding whether to hook or not based on an option or user meta value).
 For these cases, the alternatives would be to add more cache invalidation
 points (option add/update/delete, etc.), or ask the consumers to clear the
 cache themselves.
 - Updates that are not done via the regular WordPress mechanism (FTP
 updates, updates managed via git repositories, etc.). The alternative is
 asking consumers to clear the cache themselves.

 Note these two cases only if they use a persistent object cache plugin, as
 core, by default, doesn't persist.

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


More information about the wp-trac mailing list