wojciech.kapcia@tigase.net opened 4 years ago
|
|
This should be solved on redesigned accounts list. |
|
I've tried to apply this logic, however it was not usable. For some reason, last access date is not updated on macOS. Due to that I've lost most of the cached avatars. I've considers manually updating last access date (once a day) but it will not give us good results, because when we should update this value?
However, even if we would agree to update in both cases, we could still drop some "currently unused" avatars, ie. vcard avatar which is not advertised (client does not sent photo hash) and client currently has a different avatar published with PEP. Looking at the amount of data stored, I would prefer to "scale down" those avatars and keep them all instead of removing oldest once - refetching is more problematic and we do not have a huge benefit from this cleanup. |
|
Weird, it seems that in my case it's updated:
and I suggested it because of that. Regarding manual updating - I think that the OS updates this value when you read it (so your (1) case). IMHO keeping avatars that weren't displayed in more than couple of months doesn't make all that much sense, but this is huge IMHO. (Though, I'd be rather reluctant to scaling them down - in my case there are 1679 avatars totalling to ~25M which is not that much nowadays, size-wise) |
|
@wojtek I've checked and confirmed that this value was not updated in my case - timestamp matched file creation date. As for size, I've also concluded that nowadays it does not matter that much (as most of them are very small files). As for removal of "unused" avatars. It is possible that we do have 2 avatars for each JID (1 PEP and 1 VCard). If they do not match, then we 2 avatars. In the UI of BeagleIM, I'm using "the best one" (PEP if available, if not then VCard). Now it may happen that PEP will be "removed" by the user and we need to fallback to VCard and that is OK (as most likely we do have a VCard stored in the database). However, if we remove VCard avatar (ie. due to the fact that it was not used as user used PEP) and we receive presence with photo hash there is no easy way to check if the hash matches or if we need to fetch a new vcard. Right now I need to just check if file matching hash exists. Without that I would need to have a separate table "joined" with vcard to keep hashes of all photos embedded in those vcards (or fetch vcard, decode data and calculate the hash). In both cases, app would have a lot more to do than just check if file exists and benefit of this change is small if any. |
|
+1 |
Type |
Task
|
Priority |
Minor
|
Assignee | |
Spent time |
2h
|
Currently there is no cleanup mechanism and the cache can grow significantly.