Until now we used the SDWebImageRefreshCached option in SDWebImage to make sure we are using NSURLCache for caching and taking cache-control headers into account. NSURLCache seems to have trouble correctly caching URLs that have a query parameter added to them, which results in a requests made whenever an avatar is requested -> basically ignoring any caches.
We can't provide an avatarVersion for all avatars (user avatars, federated conversation avatars, etc.). Therefore we now disable the use of NSURLCache (and therefore rely on the aggressive caching SDWebImage is doing by default) but additionally append a hash from the current date to the URL. This way we can make sure that for each avatar only one request is done per day (as it is currently intended by the cache control header).
Until now we used the
SDWebImageRefreshCached
option in SDWebImage to make sure we are using NSURLCache for caching and taking cache-control headers into account. NSURLCache seems to have trouble correctly caching URLs that have a query parameter added to them, which results in a requests made whenever an avatar is requested -> basically ignoring any caches.We can't provide an
avatarVersion
for all avatars (user avatars, federated conversation avatars, etc.). Therefore we now disable the use of NSURLCache (and therefore rely on the aggressive caching SDWebImage is doing by default) but additionally append a hash from the current date to the URL. This way we can make sure that for each avatar only one request is done per day (as it is currently intended by the cache control header).