splittingred / phpThumbOf

A secure phpthumb output filter for MODx Revolution
http://rtfm.modx.com/display/addon/phpthumbof/
23 stars 17 forks source link

Update core/components/phpthumbof/model/phpthumbof/phpthumbof.class.php #46

Open mindeffects opened 12 years ago

mindeffects commented 12 years ago

Updating an image by just "overwriting" it had no effect because the phpThumbOf cache does not care about the date, only about the filename. With this little modification an image can easily be updated by overwriting it without any need to check on all the places this image was used (and refresh the cache for those). This code was originally written by Mark Horstmann (Thanks to @itWilllBeOK) for an older version of phpThumbOf but still should work: // mod: add mtime to cachename $this->cacheFilename .= '.'.filemtime(rtrim($this->modx->getOption('base_path',null,MODX_BASE_PATH),'/').$this->input);

cheers Oliver

hansek commented 11 years ago

It looks helpful.

IMO, maybe this could have some performance "issues" (increase of processing time) after transferring cache to another platform during deployment etc.

jpdevries commented 11 years ago

would a system setting to enable or disable the 'cachebusting' make it the best of both worlds?

hansek commented 11 years ago

Creation of new system settings for this feature sounds good for me!

jpdevries commented 11 years ago

Will keep an eye out for an update to the pull request :wink:

mindeffects commented 11 years ago

Thanks! A system setting is ALLWAYS nice to have! Gives the user sweat freedom of choice. ;-)

Cheers

Oliver

mindeffects creations for media.print.online

adr mindeffects e.K. · aachener str. 628 · 50226 frechen · germany fon +49-221-925533-5 · fax +49-221-925533-7 eml info@mindeffects.de · web http://www.mindeffects.de hrg Gerichtsstand Köln HR A 14875 · ust-id DE186270670 agb allgemeine geschäftsbedingungen

Am 02.10.2013 um 07:50 schrieb JP DeVries notifications@github.com:

would a system setting to enable or disable the 'cachebusting' make it the best of both worlds?

— Reply to this email directly or view it on GitHub.