Open azmeuk opened 1 year ago
IAvatarManager::getAvatar::getFile::getMTime
?
IAvatarManager::getAvatar::getFile::getMTime
?
That sounds promising for the Last-Modified
header. However to handle Etag
we might need to some caching. Last-Modified
definitively sounds an easy first step.
For the record, Last-Modified
header support came with #220 in version 2.5.0
Avatars are downloaded with curl:
https://github.com/pulsejet/nextcloud-oidc-login/blob/6ef0578b9dfeb91e4a737eab6a8d31eedee6977a/lib/Service/LoginService.php#L377-L395
However there is no notion of Etag or Last-Modified header, making the avatar being downloaded at each authentication.
We should maintain a small cache with
ETag
andLast-Modified
response headers, and pass them back in If-None-Match and If-Modified-Since headers for following requests, and ignore avatar update when we meet a 304 code.