Opened 7 weeks ago
Last modified 7 weeks ago
#59662 assigned defect (bug)
Clear block theme file caches when editing the theme in the Theme File Editor
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | 6.2 |
Component: | Themes | Keywords: | needs-patch needs-unit-tests |
Focuses: | performance | Cc: |
Description
As originally reported as part of https://core.trac.wordpress.org/ticket/59633#comment:7: Certain data from block theme files is being cached (either via object cache or transient, in different use-cases).
Any of these caches should be programmatically invalidated when editing the theme via the built-in Theme File Editor.
While for regular theme development the WP_DEVELOPMENT_MODE
constant (with a value of "theme") should be used, it is not reasonable to expect end users of WordPress that exclusively make use of the Theme File Editor to know about that.
Whenever files of a theme are being edited via the Theme File Editor, any of these caches (introduced between WordPress 6.2 and 6.4 so far) should be invalidated / cleared.
As of [56978], these caches will now only be persistent on environments using an object cache (e.g. Redis, Memcached) and will be cleared by a typical flush of the object cache. As we work on ways to extend this type of theme file caching for block themes (see: #59600), we will need to ensure editing these files via the Theme File Editor clears those caches.