The avatar endpoint returns the avatar image or, if the user has no
avatar, the display name. In that later case the avatar is generated on
the browser based on the display name. The avatar endpoint response is
cached, so when the display name changes and the avatar is got again the
browser could use the cached value, in which case it would use the same
display name as before and the avatar would not change.
When the avatar is an image the cache is invalidated with the use of
the "version" parameter, which is increased when the image changes. When
the avatar cache was first introduced only the image avatars were
cached, but it was later changed to cache all avatar responses to limit
the requests made to the server. Thus, now the cache of the display name
is invalidated too by increasing the version of the avatar if the
display name changes and there is no explicit avatar set.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* before you could request an avatar for User instead of user
which sets up the filesystem for that user twice causing
the sharing codes collision detection to detect a lot of
collisions
Signed-off-by: Morris Jobke <hey@morrisjobke.de>