[wp-trac] [WordPress Trac] #56910: Improve caching in `wp_get_global_stylesheet` and `wp_get_global_styles_svg_filters` functions
WordPress Trac
noreply at wordpress.org
Thu Nov 24 04:03:06 UTC 2022
#56910: Improve caching in `wp_get_global_stylesheet` and
`wp_get_global_styles_svg_filters` functions
--------------------------+------------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.9
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: performance
--------------------------+------------------------------
Comment (by andrewserong):
Great idea to tweak the caching logic to be more performant!
> Global styles only change if the owner of the site, makes a change or a
theme is changed
Some of the other times that the output will be changed is when a plugin
is installed or updated, or when core files change, since any of these can
alter the output of the core theme.json processing.
There are reports over in https://core.trac.wordpress.org/ticket/56970 and
https://github.com/WordPress/gutenberg/issues/45713 that sound related to
core (and its `theme.json` file and processing logic) being updated, but
new styles from the core `theme.json` file (and the associated processing
logic) not being included. So, I think any updates to the caching logic
should ideally factor in WP updates or plugin installations and upgrades,
too.
I suppose there's also the possibility of plugins allowing configuration
over things that might affect global styles output, too, so personally,
I'd still probably lean toward there being some kind of fallback timeout
for cache invalidation rather than caching indefinitely, since this area
is difficult to predict. However, things like plugin installations or
updates happen pretty infrequently, so I agree that the timeout could be
much longer than one minute.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56910#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list