As far as I understand the only way to clear the cache is to use the "OnSiteRefresh" event which is triggerd any time I hit the "clear cache" button. As a result the COMPLETE image cache is cleared.
From time to time one of my clients re-uploads some of his images. The filenames remain unchanged, but the content is different. This causes an intersting problem: The new images is not rendered by phpthumbof because it is already inside the cache.
As a quickfix I added a bit of code to the phpthumbof snippet that would overwrite the thumbs of any page that is viewed by somebody logged into manager.
This frees a manager user to do the clear cache routine just to upgrade a cached image.
BUT I don’t like that solution
It works, but it puts unnecessary stress on the server because the fact that a page is viewed by a manager user doesn’t mean that he actually changed images on that page.
Better, but still not perfect would be to ask MODX if said page was changed (saved) in the last X seconds.
I could also imagine using a TV checkbox "clear cached images" to execute this behaviour. You could activate it, then safe the document and afterwards view the document. The script could check for those parameters and overwrite the cached images of this document.
Each one of these solutions has its pros and cons. I’m not sure how to proceed so I would like to do some brainstorming before I continue.
Any recommondations?
Kind regards,
pepebe
Quote from: Kristalin at Jul 27, 2011, 02:35 AM
how can i set EXPIRATION for images which generatet from PhpThumbOF:

Please be more specific. do you want to have individual expiration dates? Do you want images to expire after n weeks...
Regards,
pepebe
Edit: Oh, I got you wrong. We are talking about client side expiration, don’t we? This is releated to header information and not not directly related to phpthumbof.
You can set expiration parametes with your .htaccess file.
http://httpd.apache.org/docs/2.0/mod/mod_expires.html
will give you some advice on that topic.
I’d have to dig into that topic to give more meaningful advice, but I hope this is helpful anyway.