Inline and Defer Option Suggestions
-
Hey Frank,
I laud you for being the first to truly tackle inlining CSS via a WordPress plugin. We’ve run into some issues with the option, however, that have made it unusable for anything other than the most stylistically simplistic installs; which, in turn, has led me to want to make some suggestions for future AO updates:
The primary problem is that, as Autoptimize’s Inline and Defer CSS option currently is, the critical CSS entered is applied globally. So, while ideal for one page… not so much for another.
To illustrate, while all pages on a site are drawing from the same stylesheets, which aspects of a site’s total CSS are and are not part of a particular page’s critical (or optimal) rendering path is nearly always different from page to page, to some or another extent (excepting, as alluded to, bare-bones, minimalist and aesthetically redundant instances). So, where the globally-applied, in-lined CSS works swimmingly on one page, it causes FOUC/FOUT/FOPUCaoT (flash of partially unstyled content and-or text) on others.
An example: a Homepage looking great, but a blog index page not rendering optimally; or, a blog index page rendering optimally, but the posts it links to issuing FOUC/FOUT/FOPUCaoT, etc. and on we go with the permutations and potentialities.
What would be great, is the capacity to apply specific, critical, in-lined CSS to specific pages with the option to apply a ‘standard’ block of in-lined CSS to the rest. For example, one block of in-lined CSS for a Homepage, one for a blog index, one for all posts, etc etc thereby solving the problems exampled above.
Best,
AJ
- The topic ‘Inline and Defer Option Suggestions’ is closed to new replies.