In order to save some resources, I want to save watermarked images to the cache dir.
Currently, I use PHP’s file_exists
to check whether the image already has been watermarked, but my question is, is there a way to save this file using CakePHP’s Cache
class?
I want to save the file to /tmp/cache/img/filename.jpeg
and load it from there as well once it has been saved.
Do you want to serve the pictures directly or through PHP?
Through PHP: just use the Cache class as with every other blob of data. Don’t bother with files, Cache will take care of that.
Directly: work with CakePHP’s File class and put them somewhere in the webroot folder.
I want to serve them through PHP preferably.
Will using the Cache class clean-up itself when the disk get’s quite full?