[wp-trac] [WordPress Trac] #56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a public function
WordPress Trac
noreply at wordpress.org
Tue Jan 24 12:30:15 UTC 2023
#56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a
public function
-------------------------------------------------+-------------------------
Reporter: oandregal | Owner:
| hellofromTonya
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.2
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: gutenberg-merge has-patch has-unit- | Focuses:
tests has-testing-info | performance
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
It seems to me, that is there is a valid use case that the cache needs to
be invalidated. A couple of cases off the top of my head.
- Unit test runs.
- A plugin that switches theme depending on request, like mobile theme if
the request is coming a phone.
- Customizor previewing new theme.
Just guessing that theme is the same is the same request might be a
problem.
It is worth noting, there is a performance hit of requesting if a file
existing and is readable 170+ times per page.
Maybe instead of a static variable or object cache, maybe a global.
Something I explored [https://github.com/WordPress/wordpress-
develop/pull/3540 here].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56975#comment:89>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list