Make WordPress Core

Changes between Initial Version and Version 15 of Ticket #56910


Ignore:
Timestamp:
01/26/2023 07:31:40 PM (23 months ago)
Author:
flixos90
Comment:

@spacedmonkey I am changing this ticket to focus just on the wp_get_global_stylesheet() function, since https://github.com/WordPress/wordpress-develop/pull/3712 is pretty much ready, and those two efforts are separate, even though the work is very similar.

Can you open a separate ticket to make the change to wp_get_global_styles_svg_filters()? I see that work is still pending a Gutenberg PR https://github.com/WordPress/gutenberg/pull/47460, and only then we can backport it to core, so it may take a bit longer.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56910

    • Property Status changed from new to reviewing
    • Property Summary changed from Improve caching in `wp_get_global_stylesheet` and `wp_get_global_styles_svg_filters` functions to Improve caching in `wp_get_global_stylesheet`
    • Property Keywords has-patch has-unit-tests gutenberg-merge commit added; needs-patch removed
    • Property Milestone changed from Awaiting Review to 6.2
    • Property Owner set to flixos90
    • Property Type changed from defect (bug) to enhancement
  • Ticket #56910 – Description

    initial v15  
    1 The `wp_get_global_stylesheet` and `wp_get_global_styles_svg_filters` functions cache data in transient for 1 minute. This means that one high traffic sites, the cache will be warmed and performance improved. But for sites with lower traffic or CDN caching ( where less traffic hits the origin ) this cache will not be warned and performance will suffer. Global styles only change if the owner of the site, makes a change or a theme is changed. These caches should be set forever and correctly invalidated. This will improve performance and mean that front end users who hit a page will not suffer poor performance.
     1**Update:** Originally this ticket also covered the `wp_get_global_styles_svg_filters` function which is subject to a similar change, but since that is a separate effort it makes sense to break it out in a separate ticket.
     2
     3The `wp_get_global_stylesheet` (and `wp_get_global_styles_svg_filters`) functions cache data in transient for 1 minute. This means that one high traffic sites, the cache will be warmed and performance improved. But for sites with lower traffic or CDN caching ( where less traffic hits the origin ) this cache will not be warned and performance will suffer. Global styles only change if the owner of the site, makes a change or a theme is changed. These caches should be set forever and correctly invalidated. This will improve performance and mean that front end users who hit a page will not suffer poor performance.