Plugin Proposal: Stylesheet Optimizer #1834
Labels
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
[Type] Plugin Proposal
A new plugin proposal
Overview
stylesheet-optimizer
About the plugin
Purpose
When using a classic theme, the stylesheets for blocks are enqueued on every page even when they are not used. Similarly, the main block-library stylesheet is also enqueued rather than enqueueing individual stylesheets for each block that is actually used on the page. This is all wasteful.
Scope
Enable the
should_load_separate_core_block_assets
filter by default, even for classic themes. Move all styles printed inwp_footer
up to theHEAD
in the original dependency order as if the filter had not been applied.This wouldn't necessarily depend on Optimization Detective since there would be no need for URL Metrics. All that is needed is the output buffering filter that Optimization Detective utilizes, and possibly the use of the HTML
TagProcessor (cf. #1546) for removing the footer styles and putting them in theHEAD
.Then again, a subsequent enhancement for this plugin could be to leverage URL Metrics to detect what the critical styles are, so a dependency on Optimization Detective may make sense.
Rationale
The idea for a plugin was raised in a support forum topic by guillermo77.
The text was updated successfully, but these errors were encountered: