[TYPO3-core] RFC #12232: Bug: md5_file() to check if a file has been changed is very expensive [performance]

Steffen Gebert steffen at steffen-gebert.de
Sun Dec 12 13:23:11 CET 2010


Hi André and Vladimir!

I agree with most points mentioned by Vladimir.

> I think Steffen meant that filemtime + filesize are enough and
> md5_file() could be dropped if no one knows usecase for it.
Exactly.

> On your patch ver 3:
> I don't like that patch is working only on new images, and still uses
> md5_file() for old ones. It means it is not fully fixes bug for existing
> sites. For example I have on one site 100 gigabytes of user uploaded
> photos, so if I want to fully fix the bug I need to empty table and
> rebuild all images and few days needed for it.
Thinking more and more about it, we should be able to deal with such 
use-cases - although it's only cache data, which (I would tend to say) 
should be removable without causing too much trouble (except a short 
load peak).

> b) by the way we don't need new DB field then, we can use old md5hash
> field, so no DB upgrade needed:
> 'md5hash' => md5(filesize($identifyResult[3]) .
> filemtime($identifyResult[3])),
yes, please use this solution

> c) AND make an extension that will parse cache_imagesizes table and
> recalculates all hashes, it will be fast and no rebuilds needed then.
Vladimir, could you provide an Upgrade Wizard for the Install Tool, 
which recalculates the hashes based on md5(filesize() . filemtime()) and 
writes them to DB?

Kind regards
Steffen

-- 
Steffen Gebert
TYPO3 Core Team Member

Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list