Visual Eagle
Elite Member
- Dec 11, 2008
- 2,630
- 2,282
Hello people.
So I've been playing around with my WordPress sites and checking if there is anything I can still improve to my loading speed. I've found out that at least in my case the "site identity icon" which WordPress recommends at 512x512 res. was cropped to 192x192 and 32x32 and loaded two times with even a delay after all the files have loaded.
How you can check if you are affected?
Most probably you are if you are using "site identity icon" via customize on WordPress. Visit the following website and test it out. Check the graph of all the loaded files and see if you have the same thing I have (2 favicons loading).
https://tools.pingdom.com/
Are you affected? If so, proceed with the following...
Before you proceed, I recommend that you resize your icon to something like 128x128 or 64x64 to make the site even smaller. If you want to be on point with favicon size then you can resize it to 16x16 (use photoshop or any other software) to decrease the size of the icon.
Step 1: Convert your favicon into a data-URI. Use the website below to do exactly that.
http://dataurl.net/#dataurlmaker
Step 2: Replace your existing favicon with the following code (use in function.php)
Step 3: Make sure you remove the icon from the customize page so the new data icon will load.
While this probably will break the usage of having an icon on home screen on mobile phones when people bookmark the site to the launcher (if any even do that I know I only bookmark in the browser). It helped me improve my loading speed of about 700MS.
So I've been playing around with my WordPress sites and checking if there is anything I can still improve to my loading speed. I've found out that at least in my case the "site identity icon" which WordPress recommends at 512x512 res. was cropped to 192x192 and 32x32 and loaded two times with even a delay after all the files have loaded.
How you can check if you are affected?
Most probably you are if you are using "site identity icon" via customize on WordPress. Visit the following website and test it out. Check the graph of all the loaded files and see if you have the same thing I have (2 favicons loading).
https://tools.pingdom.com/
Are you affected? If so, proceed with the following...
Before you proceed, I recommend that you resize your icon to something like 128x128 or 64x64 to make the site even smaller. If you want to be on point with favicon size then you can resize it to 16x16 (use photoshop or any other software) to decrease the size of the icon.
Step 1: Convert your favicon into a data-URI. Use the website below to do exactly that.
http://dataurl.net/#dataurlmaker
Step 2: Replace your existing favicon with the following code (use in function.php)
function add_favicon() {
echo '<link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;base64,visualeagle copy url code here.......=" />';
}
add_action('wp_head', 'add_favicon');
Step 3: Make sure you remove the icon from the customize page so the new data icon will load.
While this probably will break the usage of having an icon on home screen on mobile phones when people bookmark the site to the launcher (if any even do that I know I only bookmark in the browser). It helped me improve my loading speed of about 700MS.