WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Help getting Minified file location (3 posts)

  1. adamsadowski
    Member
    Posted 7 months ago #

    As I'm sure many of you know, Google PageSpeed Insights will sometimes complain about what it calls "render blocking css" when you test your sites.

    Their suggestion is to render only "necessary" CSS inline in the <head>. If you have CSS in an external file (as everyone does), the recommendation is to load this after the page loads. This seems pretty extreme, but that's the recommendation. It appears to be a big blocker to improving one's Mobile PageSpeed scores as well...

    You can use the PageSpeed Module for Apache or nginx to help you identify which CSS is actually "necessary". Again, one can argue about the relative value of doing this, but it is Google's current recommendation.

    I had a notion to use javascript to "Lazy Load" the CSS file by having a small script fire in the footer of my theme, injecting the CSS into the head. You can see an example of this technique here: https://bensmann.no

    I would then put <!-- W3TC-include-css --> inside a <noscript> tag, thereby suppressing the placement of the minified CSS, as well as ensuring it appears for non JS browsers.

    So, the issue is I need to get the location of the minified CSS file somehow. Anyone know how one can access the location of minified CSS file with PHP in the footer?

    http://wordpress.org/plugins/w3-total-cache/

  2. bolt24
    Member
    Posted 7 months ago #

    Your page got 100/100 at Pingdom. There's not much more you can do :-)

    What plugins do you use for this speed right now?

  3. adamsadowski
    Member
    Posted 7 months ago #

    Not my page unfortunately :-). I'm trying to replicate the technique he's using by lazy loading the minified CSS that w3tc produces. Unfortunately, I can't figure out how to pull the hash and the Filename w3tc produces in my footer.php

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.