Skip to content
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

Cache global-styles #25678

Closed
aristath opened this issue Sep 28, 2020 · 1 comment
Closed

Cache global-styles #25678

aristath opened this issue Sep 28, 2020 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Performance Related to performance efforts

Comments

@aristath
Copy link
Member

In FSE themes global styles are coming from the theme's theme.json file, and overall we have 3 sources of styles:

  • Core
  • Theme
  • User

These don't change on each page-load and could be cached to improve performance. We don't need to parse the JSON file from the theme on each page-load (unless we're currently developing a theme), or generate the CSS again and again.

We could cache the resulting CSS if

  • WP_DEBUG is set to false
  • SCRIPT_DEBUG is set to false
  • Not in the editor
@aristath aristath added [Type] Performance Related to performance efforts Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Sep 28, 2020
@aristath aristath mentioned this issue Sep 28, 2020
6 tasks
@aristath
Copy link
Member Author

An initial implementation for this was done in #25680
We can improve it as we go, but for now I'm closing this ticket. Further improvements can be done in separate tickets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Performance Related to performance efforts
Projects
None yet
Development

No branches or pull requests

1 participant