Andrei's suggestion seems efficient, because we calculate md5 for every new
bookmark and after that we have to compare 16-byte length strings in the
whole database.
Jon's approach is fine too, because it's rare to have many favicons for one
domain, and it will be found after few comparisons without extra overhead of
calculating md5 sums. but before comparison, we should lookup domain name in
the whole database.

Which one is more efficient in your opinion?

On Tue, Aug 30, 2011 at 6:21 PM, Andrei Nistor <[email protected]> wrote:

> On Tue, 30 Aug 2011 13:52:27 +0100, Jon Spriggs wrote:
>
>> How about this for a favicon workflow?
>>
>> 1) Download favicon. It's the first time it's been used, store it as
>> www.example.com.0.ico and add that favicon to the database.
>> 2) Second person adds a bookmark in www.example.com. Download the
>> favicon, and then diff it against each of the dns-named favicons which
>> have been downloaded - currently only www.example.0.ico - if it's the
>> same, delete the downloaded favicon and re-use www.example.com.0.ico
>> in the database. If it's not the same store it as
>> www.example.com.1.ico.
>> 3) User deletes their bookmark which is the last instance of
>> www.example.com.0.ico. System deletes www.example.com.0.ico from the
>> system.
>>
>>
> I'd like to propose an alternative:
>
> Download favicon, compute it's hash (using MD5/SHA1/whatever). Look up the
> hash in the database, if it doesn't exist, insert it, if it exists, use it.
>
> P.S. sorry for the double reply, missed the CC list on first try.
> --
> Andrei
>
_______________________________________________
Owncloud mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/owncloud

Reply via email to