Learn how to cache gravatar images in WordPress to optimize your site speed. Why caching gravatar images can make a lot of difference to WordPress performance?
The website load time statistics show that images can contribute 43% of a web page. Then why not load these images properly.
By default, the Gravatar Images retrieve from gravatar.com to your website. Hence gravatar images increase the number of HTTP requests on your WordPress site. And thus make your website slow.
If there are a lot of comments on your blog posts, the default method of loading gravatar images from gravatar.com can make your web pages really slow. Because loading time of gravatar images of all the commenters will add up. Every time someone visits a blog post, all gravatar images will be loaded from gravatar.com. This does not seem like an efficient way of loading Gravatars, right!
You can leverage caching of Gravatar Images to overcome this problem.
Wait, did you just say that you are already using a WordPress cache plugin on your WordPress site?
Okay, but WordPress cache plugins do not take care of caching of gravatar images.
So, what should you do?
How to Cache Gravatar Images in WordPress
You can use FV Gravatar Cache WordPress plugin to cache gravatar images in WordPress. This plugin comes with some really useful features. Like… you can see cached gravatar images from the plugin’s Settings page itself. The plugin stores gravatar images on the server where your WordPress site is hosted. Hence cut down the number of external HTTP requests.
By default, the cache directory (to cache gravatar images) is under this plugin’s folder (wp-content/plugins/fv-gravatar-cache/images/). However, you can use the Custom Cache directory as well.
Step by step instructions to Cache Gravatar Images in WordPress:
- Install and activate FV Gravatar Cache WordPress plugin from WordPress plugins directory.
- Go to Dashboard > Settings > FV Gravatar Cache.
- Set up the basic settings of the plugin. (as per image below)
- Hit Run Cron Now, the plugin will start caching gravatar images in WordPress. It will take a while depending on the number and size of gravatar images.
- Once the caching is done. You can see cached images under Cache information.
- Finally, click Save Changes and you’re done.
You might be wondering what if somebody changed his/her profile image on Gravatar but your website is displaying his/her cached image from your server. You don’t need to worry about that, this plugin cache Gravatars with WordPress cron job and sync images after a certain period of time. All you need is to enable (check) Daily cron option in the plugin’s settings.
Since you are working on making your WordPress site load faster, you can consider:
- Deferring Offscreen Images in WordPress to Speed Up Your Website
- Make use of 7 Best Free CDN Providers for WordPress Website
Does your website show Optimize Images warning in Google Pagespeed Insights? Learn how to optimize images in WordPress properly.
If you are using gravatar images on your WordPress site, you must consider caching gravatar images. As caching gravatar images will help to load your website faster and optimize your site speed. Faster loading website is good for user experience as well as SEO and rankings of your website.
Are you sure? You Leverage Browser Caching in WordPress for Best Performance.
I hope this article helps you to cache gravatar images in WordPress to speed up your site. If you are using some other method or plugin to cache gravatar images in WordPress, feel free to share with me and other readers via the comment section below.
You may also like: