-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fonts API] Performance: Cache dynamically generated @font-face
rulesets
#42873
Comments
I agree 100% |
This is a great suggestion. ❤️ 💯 |
As part of WP#6531, WordPress 4.9 introduced caching of the templates dropdown in the editor on the basis that it was work that shouldn't be repeated on each page load. It was reverted in WP#42573 for WordPress 4.9.1 as it became problematic when themes were updated. With this in mind, I'd suggest the following:
I'd also suggest using the object cache rather than a short lived transient. Sites that get enough visitors for a short lived cache to provide a benefit are likely to be using object caching, a short lived transient will add database calls that may slow the site down as short lived transients are not autoloaded in the options table. |
@font-face
rulesets@font-face
rulesets
The Fonts API is being replaced by Font Face to work with the new font management direction and Font Library. I don't currently see a need for caching I'm closing this issue. In the future if there is a performance issue with the generation and printing of Thank you everyone for your contributions! |
Part of #41479.
Problem Statement
Currently, the API dynamically generates the global
@font-face
rulesets on each web page request. But these global typography web fonts do not change on each request. Rather, they change with an event such as through user selection (via global styles UI), theme change, plugin change, and possibly programmatically in a specific template or web page (such as a forum, landing page, etc.).Dynamically generating the rulesets each time is wasteful.
Scope
This issue proposes caching the
@font-face
rulesets and then clearing the cache when specific events happen.Part of this scope then is to identify the "specific events" while providing a way for extenders to manually clear the cache.
The text was updated successfully, but these errors were encountered: