Cache_Graphics and expiration
| From: | lustig at brandeis dot edu | Date: | Thu, 23 Jun 2005 17:28:56 +0000 |
| Subject: | Cache_Graphics and expiration | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19746@lists.php.net to get a copy of this message | ||
Hi everyone!
I've just started doing work with PEAR::Cache, and it's fantastic! I really
like it. My problem is this- I am using the Cache_Graphics class to cache the
output of some images that are being created by GD, and is being assigned a
specific ID from an MD5 hash.
There are two things I want to do: I want to set it so that these cached image
files expire after a certain period of time (say, 24 hours), and also I want
to be able to expire them manually. Say for example, I have a page that
generates a graphic displaying relationships between users. I might want this
to be refreshed every day (the automatic expiration), and also whenever the
relationship data changes, I want it to know that now it needs to re-create
the image instead of using the cache.
From what I understand, if I use output buffering and the Cache::save()
function, this will allow me to set an expiration time, but I'm using the
Cache_Graphics::getImageLink() function, because it's important for me to not
have the additional page hit (which is what would happen if I had the <img>
tag go to another page to do the output buffering).
Any thoughts?
Thanks a lot,
Jason