@ChristoperSimmons
I still didn’t understand your answer last explanation. What you mean by:
graphics loading from the network portal vs localized, and it looks like you don’t have the setting activated for mod_pagespeed to insert image dimensions?
Hi again 🙂
Question, i’m trying to defer parsing of javascripts by adding this code to the theme’s functions.php
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
Works great! Only the images disappeared from the posts.
I guess i have to exclude some javascripts, but which one, and how?
Thanks!
TO ALL:
Christopher Simmons
August 27, 2014 at 8:50 pm #19552
As you may know from my own prior posts in the pagespeed topic, you may find it more helpful to test for speed with stuff like adsense, external things like addthis/sharethis or shareaholic, disqus, turned OFF, as there is not much you can do about those elements for speed beyond async loading. This gives you what I call your “raw score” which is better to see what your work on optimization actually does.
The “theory” in the webdev industry is that if you get your raw score taken care of, then when you switch back on the googleverse stuff which invariably shows problems with their own systems vis a vis pagespeed, you can presume Google “subtracts” their own content from the “functional score” … in using speed as a “signal” for ranking, beyond user experience.
Just for those pulling their hair out on this topic (been there!) 🙂
My other advice: don’t eat toast around your keyboard, unless you want to keep a key puller, alcohol, swabs, and a can of compressed air handy!!
Hi Christopher,
I know that but the thing is, some website are getting 97 with AdSense and Shareholic turned on. For example, one of the forum member, Shashank has ads on his website and shareoholic as well but he has 97. (http://www.styzic.com/). I guess you have AdSense and you do have a brilliant page speed…How is it possible, then? :/ Please help.
Well, several things you can do
1) use only text ads from adsense, so images are not loaded (one big issue right there)
2) very aggressive caching and/or proper CDN
3) fast server (less than 300msec response time)
4) avoid stuff like photon or other stuff loading off wordpress
5) optimize your social media stuff; use share buttons not the numerical crap that needs to go “fetch” numbers for EACH button
6) load fonts from your own CSS not from Google CSS; or use web safe fonts ONLY
7) limit use of plugins which slow down your php
8) optimize your config.php file to include paths to your resources
9) do not use child theme which uses css redirect which google does *not* like
etc.
I’m sure Shashank could likely provide a single “round up” of all the stuff he’s done in the particular case of his own site. I just tested one of his pages, which as a desktop score of 93, mobile 86; which is pretty damn impressive with adsense and disqus running!
https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.styzic.com%2Fgadgets%2Fiphone%2Fbigger-iphone-6l%2F491%2F&tab=desktop
-
This reply was modified 11 years by
simchris.
@Christopher, what do you mean by “load fonts from your own CSS not from Google CSS; or use web safe fonts ONLY”? Please explain.
Some of the things I noticed on his site was not using the gravatar, which is a major slowdown, and also he’s limiting the number of thumbs on page, such as not having four big “related stories” images at bottom of post, and as I suggested he’s using only the share buttons vs the number shares buttons.
I just checked one of my pages, which does not have js/css minified, and has gravatar, and has an ajax slider top right AND four images for related posts. This page has a “90” on PageSpeed Insights with both AdSense, and Disqus running. And one of those things is loading Google Analytics even though I am not. I’m not using a caching plugin either. So, in my case I need to consider changing the related posts, figure out how to cache or save the author image locally vs from gravatar, and possibly remove the big image slider top right of each page … which would reduce payload of page by a lot. And I need to minify my main js and style.css files, and retest. I haven’t looked at this since before I got sick, and have been working on something else which pays the bills vs the fun stuff, but need to get back to that obviously 🙂 And even worse, I don’t think I’ve updated the theme to 4.x on the test page (still 3.9.2). Doh. I suppose I should catch up on following my own advice! My non WP site has 97/100 for desktop, and 93/100 mobile.
What blows my mind, as it were, is the 99/100 user experience rating for mobile that Shashank has. May I say “wow” 🙂
“web safe fonts” refers to fonts built in to all web browsers (Google “web safe fonts”). So if you change your default fonts in your style.css file to not use ANY Google fonts, then you don’t need to load any fonts from Google (I’m using the gill sans “stack” myself). Then comment out the call to the google fonts in your functions.php file (line 48 I think, if memory serves).
This is a nice info page I usually refer people to:
http://cssfontstack.com/
To load Google fonts via your own CSS, this means that if you look at the line in your functions.php which would be loading the default google fonts for the theme (like pt sans and roboto or whatever), simply open the CSS from that link, and copy the CSS which is being loaded from Google …. then put that CSS at bottom of your style.css file … this way you’re loading the fonts directly from your CSS; not loading a CSS file externally which then loads the Google fonts … you’re cutting out a step, and removing one external file load over which you have no control. I do this on our main business site to load Open Sans from Google directly. This is a common fix for using Google fonts which has been around a few years now. 🙂
Hope that made sense.
I really need to write an ebook on this stuff with examples! 😉
@christopher, just disabled Gravatar and my post page got a bit faster: https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fgdgtarena.com%2F2014%2F08%2F26%2Fiphone-6-leak%2F&tab=desktop but how can i show the author image there?
Wellllllll…. I had trade some posts with RADU on this topic in hopes he might add a custom field on the user page for an author image loaded locally (this can be hacked from the functions.php file; I did this with one of my own responsive themes in 2011 pre-bootstrap which was insane — three column layouts without bootstrap were really a freaking pain for responsive; float right inside a float right … ugh!).
This was on my to do list before I got sick … and was just thinking the same thing 🙂
You would think there would be plugin for this, since really all it takes is adding new field to user meta for each user; then calling that from the theme author box template.
This may be my Labor Day weekend project ! 🙂
example how to on this topic of adding custom user meta
http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields
in the above case we’d be replacing a twitter field with a user photo field, where we could put in local URL to the user photo (e.g., /uploads/my-name-here_100x100.jpg); then call that in the Newspaper theme.
@Christopher What if I use the font by doing @import and upload the font files to the server? Will it make the site slower?
Could anyone help me with my problem?
This is it: https://forum.tagdiv.com/topic/placing-ads-below-the-main-menu/
@Lukao350
you don’t need to do multiple posts for same issue. This has nothing to do with PageSpeed. So you should post the question as NEW topic for support 🙂
Lucian or Marius from TagDiv support will answer stuff as soon as they are back in at their local business hours.
Okay… SOLUTION to the gravatar pagespeed issue with the crappy 5 min. time to live (expiry/caching).
I didn’t want to hack my functions again to make new user meta field, if there was plugin to do it, and finally found one that *works* with Newspaper and WP 3.9.2 to replace the author image from Gravtar, which raises optimization error on Google PageSpeed Insights, with this plugin:
Simple Local Avatars
http://10up.com/plugins/simple-local-avatars-wordpress/
also in the WP plugin repository on wordpress.org
W3 and Speed Booster Pack are giving Newspaper a real speedboost! Watch this video:
You can download the settings that are used in this video and import them in your W3 configuration.
http://s000.tinyupload.com/?file_id=26301609429109550551
-
This reply was modified 11 years by
JBH.