Closed markRosenvinge closed 2 years ago
I'm experiencing similar issues with the avatar images being cached. Is there a work around for this available?
There is currently a Pull Request that may fix this issue. I do not have a timeframe when this will be resolved/merged in but you may merge in this Pull Request prematurely if you need it done urgently.
Hi,
There is a challenge in this plugin with browser cache or using cdn's or reverse proxies. This happens because the avatar image is saved with the same name every time and there is no cache busting applied to the render of the images.
Wordpress tries to accommodate for this by changing the location of the folder with year and month, but the problem still occurs if the images is changed within the same day.
An easy fix for this would be adding a unix timestamp to the image name when uploading a new image. This could be done in the
unique_filename_callback()
method.A more smooth solution would be for grab is any existing avatars with the same name before running
avatar_delete()
and then incrementing the counter inunique_filename_callback()
based on that aswell.