WordPress shows a small profile picture next to each comment. By default, these pictures come from gravatar.com. So every page with comments makes the visitor’s browser connect to another site. Softminal Cache can keep a copy of each picture on your own site and show that copy instead (local avatars).
Why use it
- Faster pages: the browser does not need to connect to gravatar.com, so pictures load sooner.
- Better privacy: your visitors’ browsers never contact gravatar.com.
It helps most on blogs and sites with many comments.
How to turn it on
- Go to the Optimize tab, then Images.
- In the Load images when they’re needed card, turn on Keep Gravatar pictures on your site.
- Click Save changes.
How it works
- When a page shows a Gravatar picture that we do not have yet, the page still uses gravatar.com that one time. The picture is put in a queue.
- A few seconds later, a background job (WP-Cron) downloads the queued pictures. Nothing is downloaded while a visitor waits.
- From then on, the page uses the copy on your site.
- Each copy is refreshed every week, so new profile pictures show up.
- Copies that no page has used for about three weeks are deleted. At most 2000 pictures are kept.
The copies are kept in wp-content/cache/softminal-cache-assets/avatars/. Pictures are only downloaded from secure.gravatar.com, and each file is checked to be a real image.
Admin screens still use gravatar.com. Only the pages your visitors see change.
What can go wrong
Right after you turn it on, the first visit to a page still shows pictures from gravatar.com. That is normal. The cached copy of that page keeps those addresses until the page is cached again. To see the local pictures sooner, clear the cache a few minutes after you turn this on. See Clearing the cache.
Pictures never change to local copies? WP-Cron may not run on your site. Check that scheduled tasks work, or ask your host.
Some themes or plugins build Gravatar addresses with extra options. We leave those addresses alone, so those pictures still come from gravatar.com.
Turning the switch off deletes all the copies. Pages go back to gravatar.com.
How to check it works
After it is on, the setting also says how many pictures are kept, for example “25 pictures are kept on your site now.”
Open a post with comments in a private window and view the page source. Search for avatars/. The picture addresses now start with your own domain. See also Forms and comments.