Forum Replies Created

Viewing 15 replies - 16 through 30 (of 210 total)
  • You wouldn’t believe how many inquires we get about that button Frank lol. You REALLY gotta move that thing somewhere else or add some attention getting color. ??

    AJ

    Hi folks,

    A couple things —

    1.) From PageSpeed Insights’ FAQ:

    PageSpeed Insights’ analysis does not use real devices. PageSpeed Insights fetches a site with a webkit renderer (the same rendering engine that powers Chrome and Safari) that emulates both mobile device and desktop devices.

    Overly simplified translation: This sh!t ain’t real, yo. So always use WebPageTest.org to verify/falsify PSI’s claims of render blocking resources.

    2.) Enqueuing JavaScript in the footer is no guarantee that it won’t block rendering. If for example Chrome thinks a JavaScript file enqueued in the footer is necessary to properly parse a page’s above the fold content, that file will indeed block rendering unless the defer or async attribute is present. On extremely rare occasions it will even ignore those.

    Be well,
    AJ

    Oops, forgot. Add this with Code Snippets or to functions.php. The code will work for all properly enqueued scripts.

    AJ

    /*Function to defer or asynchronously load scripts not aggregated by Autoptimize*/
    function js_async_attr($tag){
    
    # Do not add defer or async attribute to these scripts
    $scripts_to_exclude = array('script1.js', 'script2.js', 'script3.js');
     
    foreach($scripts_to_exclude as $exclude_script){
    	if(true == strpos($tag, $exclude_script ) )
    	return $tag;	
    }
    
    # Defer or async all remaining scripts not excluded above
    return str_replace( ' src', ' defer="defer" src', $tag );
    }
    add_filter( 'script_loader_tag', 'js_async_attr', 10 );

    defer="defer" can also be async="async"

    ??

    Be well,
    AJ

    Correct Ivan.

    The Per Page Add to Head Plugin enables you to automatically add the font CSS to every page and post by adding the CSS only once, whereas with AO you have to add it for every critical CSS file added with Frank’s (totally awesome) Critical CSS Powerup.

    So if you’ve already taken the time to add it to all those critical CSS files then yes, you’ll have to manually remove the font CSS from them or you’ll just be adding page weight and redundant code.

    Be well,
    AJ

    Sorry Ivan, it seems I’ve lost you.

    You don’t need Code Snippets, just Per Page Add to Head. The ‘doctoring’ of the plugin is done directly on the plugin’s perpagehead.php file. Which — depending on the website — may or may not be necessary (but should be experimented with to find the performance sweet spot).

    Be well,
    AJ

    Oh i get it. I just wanted to make sure you’re aware of the option in the event that Frank doesn’t opt for your suggestion.

    One other thing about Per Page Add to Head though, for you — if you need it — and the audience:

    1.) In Per Page Add to Head’s files, find and open perpagehead.php

    2.) On line 119 (or thereabouts), you will see

    add_action('wp_head', 'perpageath_display', 1000);

    3.) Change this to

    add_action('wp_head', 'perpageath_display', 0);

    In other words, simply change the “1000” to “0”.

    This will get inlined fonts as high in the source code as possible.

    Be well,
    AJ

    You can also add those inline using Per Page Add to Head Ivan, thereby bypassing AO’s Critical CSS feature.

    You’ll need tags though, something like:

    <style id="Ivans-fonts">@font-face{font-family:Lato;font-style:normal;font-weight:300;src:url(wp-content/fonts/lato-v11-latin_latin-ext-300.eot);src:local('Lato Light'),local('Lato-Light'),url(wp-content/fonts/lato-v11-latin_latin-ext-300.eot?) format('embedded-opentype'),url(wp-content/fonts/lato-v11-latin_latin-ext-300.woff2) format('woff2'),url(wp-content/fonts/lato-v11-latin_latin-ext-300.woff) format('woff'),url(wp-content/fonts/lato-v11-latin_latin-ext-300.ttf) format('truetype'),url(wp-content/fonts/lato-v11-latin_latin-ext-300.svg) format('svg')}@font-face{font-family:Lato;font-style:italic;font-weight:300;src:url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.eot);src:local('Lato Light Italic'),local('Lato-LightItalic'),url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.eot?) format('embedded-opentype'),url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.woff2) format('woff2'),url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.woff) format('woff'),url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.ttf) format('truetype'),url(wp-content/fonts/lato-v11-latin_latin-ext-300italic.svg) format('svg')}@font-face{font-family:Lato;font-style:normal;font-weight:700;src:url(wp-content/fonts/lato-v11-latin_latin-ext-700.eot);src:local('Lato Bold'),local('Lato-Bold'),url(wp-content/fonts/lato-v11-latin_latin-ext-700.eot?) format('embedded-opentype'),url(wp-content/fonts/lato-v11-latin_latin-ext-700.woff2) format('woff2'),url(wp-content/fonts/lato-v11-latin_latin-ext-700.woff) format('woff'),url(wp-content/fonts/lato-v11-latin_latin-ext-700.ttf) format('truetype'),url(wp-content/fonts/lato-v11-latin_latin-ext-700.svg) format('svg')}@font-face{font-family:Lato;font-style:italic;font-weight:700;src:url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.eot);src:local('Lato Bold Italic'),local('Lato-BoldItalic'),url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.eot?) format('embedded-opentype'),url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.woff2) format('woff2'),url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.woff) format('woff'),url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.ttf) format('truetype'),url(wp-content/fonts/lato-v11-latin_latin-ext-700italic.svg) format('svg')}</style>

    Be well,
    AJ

    Duplicate

    W3TC can only alter the headers of assets served from your server.

    Be well,
    AJ

    ??

    @nrgini,

    Exclude wp-includes/js/jquery/jquery.js and inline JavaScript and your slider will work (99.9374635251737464 % certain).

    Be well,
    AJ

    I suggest to include a feature to move the css and js at the bottom of the page avoiding the page render blocking, since this is the worst part of handle in all themes and plugins integrations.

    Two things to add to Frank’s remarks:

    1.) As Frank alluded to, the majority of WordPress websites have jQuery dependencies. So, most people are going to have to leave jQuery loose in the <head>, uncombined with the rest of a website’s JavaScript. jQuery figures so prominently in all things WordPress that it is a part of WordPress’s core. In most instances a website will have to be built from the ground up with little or no reliance on jQuery in order for jQuery to not have to be a render blocking resource.

    2.) Forcing all CSS to the bottom of the source code will give you better scores on best practices tools like PageSpeed Insights, sure, but doing so will also break your website. It’s important to remember that best practices tools make suggestions… However, if these suggestions are not interpreted correctly they can be counterproductive.

    Because it makes for a superior user experience, Google likes to see progressive rendering, not high scores on PSI achieved by breaking your website in such a way that — by definition — provides a poor user experience.

    Be well,
    AJ

    Wonderful. ??

    You’re certainly a step ahead of the rest now, ossser (and I’m always there in the course to help you, you need but ask).

    WordPress performance optimization summed up in three words: Test, test, test. ??

    Be well,
    AJ

    Thread Starter AJ @ WpFASTER.org

    (@ajm_1976)

    Thanks for the reply, Brian,

    The option woud be nice as currently no browser supports HTTP/2 unencrypted and not all websites are being served over SSL. There’s also still a lot of people lunking around on antiquated browsers for which sharding is inherently effective.

    Lastly, there are indeed scenarios/dynamics in which sharding over HTTP/2 is effective if implemented correctly; which is why, as one example, and at least in part, the rewrite_domains PageSpeed filter still exists.

    Be well,
    AJ

Viewing 15 replies - 16 through 30 (of 210 total)