Possible web acceleration potential by embedding CSS only in pages where used
-
Generally when it comes to web acceleration each HTTP request fewer is better!
I plan to insert a Shortcode block with a page-list shortcode in only a few pages of my block-theme based WordPress website. And I make use of caching for web acceleration. I wonder if it is possible to:
- Only embed page-list CSS into pages where the shortcode is actually used, so that visitors which visit purely pages without page-list never need to load its CSS file.
- For pages which feature a page-list shortcode possible think about that in addition to embedding CSS via
<head> ... <link rel="stylesheet">
also offer an option to enqueue the CSS inline (currently: 70 lines, 1250 bytes) rather than using the external CSS file. Possibly with the mechanism of the theme.json Style Engine (just an idea, don’t know if that would work, am no developer).
For those websites which use page-list only in limited parts of their websites a more differentiated embedding mechanism possible pays off performance wise.
- The topic ‘Possible web acceleration potential by embedding CSS only in pages where used’ is closed to new replies.