Hi,
I’m starting to make an effort to optimize the site for PageSpeed, and couple of minor things:
test page
http://ga-ga.com/1890/book-review-people-deserve-a-fighting-chance/
1) is it possible to setup the use of the optimum thumbnails for this kind of page layout? Basically actually using 200×150 images vs resizing them? I currently have 200×150 as one of the 3 sizes in the wp admin > media > small/medium/large, however the page blocks on posts don’t actually use the 200×150 size thumbs.
(to correct listed as “error” for pagespeed)
resized in HTML or CSS from 238×178 to 200×150. Serving a scaled image could save 1.5KiB (30% reduction).
2) can we set pages and posts and categories, etc., to NOT load the visual composer CSS since it’s only used on home page?
/wp-content/plugins/js_composer/assets/css/js_composer.css
3) getting this issue, which I don’t recall seeing before when doing past optimizations, and not sure if something in ad module is loading something via BOTH http and https, or if this is strictly an issue on Google ad side of the load:
The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 1 request(s) and 9.2KiB.
•http://pagead2.googlesyndication.com/bg/-GgkI9xeVCztemwrHKdpGDGZZ7feSdeVfZSSdFvmVw8.js
•https://www.google.com/js/bg/-GgkI9xeVCztemwrHKdpGDGZZ7feSdeVfZSSdFvmVw8.js
4) best way to defer parsing of this javascript
•http://ga-ga.com/wp-includes/js/comment-reply.min.js (622B)
•http://ga-ga.com/wp-content/plugins/akismet/_inc/form.js (533B)
Thanks folks 🙂
Hi,
1. You could add a new size like this – http://screencast.com/t/X82FaXO9o
array(
'name' => 'td_200x150',
'width' => 200,
'height' => 150,
'crop' => array('center', 'top'),
'used_on' => array(
'Related articles'
)
)
Enable it from the Theme Panel – http://screencast.com/t/ikTADp1Wdcv
Regenerate thumbnails using Force Regenerate.
Result – http://screencast.com/t/YBErs1WoAT
2. Try this code (add it at the end of functions.php):
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
add_action('wp_enqueue_scripts', 'dequeue_visual_composer_css', 1003);
3. I’ve added this issue on the list, we’ll investigate.
4. You could try defer, async may give some errors:
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer=\"defer\" '";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
Thank you, Emil G.
Hi,
I’ve looked into the google js issue, on my side i seem to get one “http://pagead2.googlesyndication.com/bg/jACmYeRZT1uYewaSfEm9ZJGn45b–s9m1bTragMWMow.js” for each ad (i have 3 ads) – http://screencast.com/t/NZ5m4xeQ2dM , i also checked your link and i found two – http://screencast.com/t/WEKb9Lqv9 there are no https requests. Could you provide more details?
Thank you, Emil G.
It’s odd on the http/https thing.
I’m getting that error from GTmetrix, as you likely know and appears to be from the advertisements.
Not using https on ga-ga.com – and using the newest “responsive” code snippet from AdSense – nothing oddball with that at all.
I’m playing with it to see if I can debug that.
using same code for header and and sidebar
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 2014-Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="xxxxxx"
data-ad-slot="xxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
