All throughout childhood, we learned the value of patience and how it is a virtue. Even so, patience runs thin when we visit slow websites. As such, speeding up our blog is in the best interest of not only readers but also us. On this article, let me share how WordPress avatars in comments turn our pages into turtles. Also, I will propose a simple solution for faster page load time.
Who is this post for?
In relation to the topic of this article, it is for people who have a self-hosted WordPress site. In particular, it is for sites that allow commenting with Avatar Display turned on.
Importance of Page Load Time
As I alluded to earlier, a web page that takes forever to load can test our patience. With each passing second, here are our options.
1. Unleash a storm of expletives and continue waiting.
2. Leave the site.
Imagine if that is our blog with horrible site speed.
I am sure you will agree with me that as bloggers, we want people to visit and read our posts. Hence, the last thing we want is to have the audience choosing one of the two options above.
How much time are people willing to wait for a web page to load?
I came across an interesting study conducted by Akamai. While it was a study made for e-commerce websites, it does reflect the attitude of visitors as well as ours.
Back in 2006, they found out that on average, people were willing to wait for no more than 4 seconds. After three years, in a similar study, it was down to 2 seconds. No doubt, the wider availability of broadband has contributed to the increasing impatience.
How did I find out how fast or slow a blog page loads?
I used the free online tool from GTmetrix to test a previous blog post.
In both metrics, the page load time took 4.2 seconds from a server in Vancouver, Canada. Compared to other sites, I can say that the loading time is decent but a little tweak can make it much better.
Having people leaving comments lets us know how they feel about our posts. Depending on preference and purpose, some sites do not allow comments. As for those who do, some opted to disable the use of WordPress avatars.
In the test results that I showed you, there were 11 comments on the article on ideal blog post length. 8 of them were by the audience while three were my replies. All in all, there were five people, including me, using Gravatar images.
I like having a profile photo of commenters because it makes the comments more personal. Not to mention, it helps with the aesthetics as well.
Unfortunately, as one can see from the images I shared, it also affected the page load time.
At this point, I have three options.
1. Disable commenting.
2. Allow commenting but turn off WordPress Avatar Display.
3. Do something about it.
Of course, I picked the third option, and I will also show you how I did it to speed up the page load time.
WordPress and Gravatar Images
Gravatar is a service owned by Automattic, the same team behind WordPress. Anyone who signs up and uploads a profile photo, it becomes available in their other services. It is why profile pictures appear in WordPress blog comments automatically.
Here is how it works.
When I leave a comment on a WordPress site, I leave the same email I used with Gravatar. If the Avatar Display option is on, the platform now connects to the servers of Gravatar to pull up my avatar.
From the test result, it is evident to me that the host connects to the remote Gravatar server several times. In fact, it looks to me that it does so for each comment.
It means that with more blog comments, the web page will have poorer page load time.
Once again, I have to make a decision. I can choose to turn off the blog commenting section. Another option is to close the comments after X number of days lapses since the publication date.
Like I kept alluding to, though, there is a way to improve the page load time.
Speed Up WordPress Gravatar
Sometimes, a complex problem requires only a simple solution. As such, there is no need to tinker with the code. As it turns out, all we need to do is to install a free plugin called FV Gravatar Cache.
It is a straightforward plugin that after installation. At the settings page, the only thing needed is to turn on the option for daily cron. Save the changes and let it work in the background.
Here is what it does.
The plugin visits Gravatar to download the commenters’ avatar and save to our server. It does so in the background so give it some time before it completes the task.
Once done, the web page can serve the images without the need to access a remote server. Hence, the blog page load time speeds up.
Here are the new scores on the same page I used earlier.
PageSpeed is up to 93% while YSlow improved to 86%. Even better is the 36% increase in page load time. From 4.2 seconds, it is now down to 3.1 seconds.
Some people may think that shaving off a second is not a big deal. Believe me, it is.
Like I said, there were 11 comments when I checked the web page speed.
Imagine how much longer it takes with more blog comments.
Foliovision, the plugin developer, says it takes 100ms for each connection to Gravatar. In other words, it is as if every 10 comments will add 1 second to the page load time.
Beyond 4 seconds, each passing second increases the likelihood of the visitors leaving.
Do we want that for the blog we worked so hard on to get started and maintain?
Using Gravatar with WordPress does make the blog comment section look nicer. But it comes at a cost. In the end, the price we pay can be visitors not seeing our posts, or we can do something about it.