Plugin inserts CSS into head of each page regardless whether it has iFrame block
-
Web acceleration basics: Each HTTP request fewer is better!
Whereas as soon as one enables your plugin:
1) Each page/post in its
<head>
contains an extra CSS file:<link rel='stylesheet' id='simple-iframe-style-css' media='all'/>
regardless whether it features an iFrame block or not.
2) That CSS file is empty, so has no use anyhow. But nevertheless ofc causes an HTTP overhead.
Could your plugin possible get more efficient/performant in that regard?
Ad 2) If the CSS is empty anyhow, don’t insert a
<link>
element into the markup at all.Ad 1) Possible make use of the WordPress theme.json Style Engine, which
- a) enqueues styles inline.
- b) only enqueues block specific CSS if the page contains that block, otherwise leaves it out entirely.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Plugin inserts CSS into head of each page regardless whether it has iFrame block’ is closed to new replies.