• US: +1 347 223 5853   UK: +44 20 8 1234 790
  • Live Chat

Speed testing practice report

  •  admin
  •  Jul 7, 2017

<!–Globinvesting Magazine–>One of my blogs was tested on Pindom.

Main sites to test loading speed:

https://gtmetrix.com
https://developers.google.com/speed/pagespeed/insights/
https://tools.pingdom.com/

Non existing scripts (yellow)

Non-existing scripts if still added in your code or HTML can give an important slacking down on the speed test results. However, after having deleted them there were gone from the results but there was no difference at all in the total loading speed.

“Specify vary accept encoding header” (yellow)

This is a subject where e.g. Kinsta spent a whole blog post at with recommendation to add next to .htaccess:

Header append Vary: Accept-Encoding

I had the impression that the site loaded quicker but with the browser still moving quite some seconds so that the new result of the speed testing didn’t give any difference.

“Leverage browser caching”

Following Varvy.com recommendations next code was added to .htaccess:


## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"

## EXPIRES CACHING ##

In the new results, the issue had got an orange icon instead of a red one. The speed test results were still the same.

The new issue was called now:

“Remove query strings from static resources”

WordPress has a plugin to solve this, it seems, but to limit the number of plugins I searched a little bit further and fell on https://www.sourcewp.com/remove-query-strings-static-resources/
This is about “?” in URL while caching. You can’t cache this way until the “?”s are gone. The query string tells about the version and the query string can be removed with a script they give to add in functions.php:


function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

After removing non existing scripts where is still pointed to this is the second issue being fixed in the theme, the other ones were in the WordPress installation itself.

Optimizing images

Unless you use exactly the same sizes as set in the default for full, medium, small or thumbnail, often your image is bigger than represented on a web page. You can control this by right clicking on a random image and open a menu item as “View image info”.

https://havecamerawilltravel.com/photographer/wordpress-thumbnail-crop


add_filter('jpeg_quality', function($arg){return 100;});

admin

Other posts by

There are many reasons why you might choose to install resin bound paving in your commercial or residential space. Plan, track, and manage service agreements from start to finish.