Introduce function to control whether to use persistent cache for certain theme file-based logic#46791
Introduce function to control whether to use persistent cache for certain theme file-based logic#46791felixarntz wants to merge 5 commits into
Conversation
…eme file-based logic should rely on caching where applicable.
…ersistent cache this does not really matter.
|
@oandregal @spacedmonkey @mmtr Would like to get your review on this. The primary need for this function is due to the lack of any existing way to provide dedicated control over this. Neither It is less important to add since #46150, however it still provides notable value, particularly as the existing |
|
@oandregal Circling back on this: Since the latest changes in Gutenberg (also for core e.g. WordPress/wordpress-develop#3556) is changing these caches to be non-persistent, the whole idea of having the What this PR will eventually be useful for is once we can bring back persistent caching (by fixing all the quirks that previously led us to choose the non-persistent cache approach). Once we can use persistent caching without problems, we will need such a way to disable the cache again for theme developers, and only at that point this PR would become relevant really. Can you please give this a look already (more importantly this comment than the concrete code in here)? |
What?
Addresses #45912
Why?
See #45912.
How?
theme.jsonobject caches non persistent #46150, no persistent caching is used for these functions entirely, however reintroducing persistent caching in a reliable way should still be worked on in the near future.false. As noted in the code documentation, neitherWP_DEBUGnor the environment type are reliable ways to know whether a theme is currently being developed, so those aren't reliable defaults anyway. The filter introduced by this function is the main benefit here; however as of Maketheme.jsonobject caches non persistent #46150 for now enabling persistent cache is discouraged except for experimental nature, as we keep working towards reliable cache invalidation and decoupling hooks from the cached data.