Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59719, comment 7


Ignore:
Timestamp:
11/21/2023 08:04:02 PM (2 years ago)
Author:
flixos90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59719, comment 7

    initial v1  
    44* The `themes` cache group (see `WP_Theme` class) is by default not persistent, but can be made persistent via the `wp_cache_themes_persistently` filter. This filter additionally allows to define the cache expiration to use (in seconds). If no specific expiration is defined, it's set to 30 minutes.
    55* This same filter is used to control whether to persistently cache the list of available themes (see `search_theme_directories()` function). The main difference is that here the WP Cache API isn't used, instead it uses a transient, which means even sites without a persistent object cache will receive these caching benefits. This in itself is inconsistent.
     6* There is no invalidation logic for this cache group at all. This could be okay as the data naturally expires even if persistent, but it's worth highlighting that when you for example install a new theme, it would not show up in WP Admin until the cached data expired.
    67* Eventually, we could either use this cache group for all theme data or introduce a new more specific theme cache group depending on what is being cached. This decision depends on a few factors, including whether or not we think the approach of "non-persistent by default, persistent by opt-in" makes sense for this data.
    78