Re: A question aboout Cache_HTTP_Request
| From: | The Fab | Date: | Wed, 27 Aug 2003 16:30:01 +0000 |
| Subject: | Re: A question aboout Cache_HTTP_Request | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20654@lists.php.net to get a copy of this message | ||
> I had a closer look at Cache_HTTP_Request today - and it seems be to
> quite what I've been looking for :-)
> But I'm having a small question - maybe someone can help me:
> I need to fetch data that are released via an official server 4 times
> a year - so each 3 months. I don't know the exact dates though. And
> as far as I know all cache-time are relative to the first execution
> of a Cache_HTTP_Request, right?
right
> If so I got two proposals:
> a) Would it be possible to make $expires not only being an integer
> but to also allow it being an array? In there you could e.g. include
> a specific date / time like. "expires-on" => "2003-08-30 01:00:00".
> Or you might decide to make expires-on be a unix timestamp.
> b) How about an option "re-validate"? If the content of the file has
> not been modified since a certain date there is no need to download
> it again.
> (...)
Why not cleaning the cache at given dates ?
> But I got another problem: On some systems (with small internet-
> connection - maybe an intranet-machine with only ISDN-dialup) getting
> 5mb of data from the internet might take quite long. Therefor it
> would be nice to use the currently cached data for the current
> request but spawning off a separate task to download the latest
> version. Do you have any idea how this might be accomplished?
It's maybe too specific to be included in PEAR/Cache but IMHO, I would use
a cron job called 1 time a month which will clean the cache if it's the
good month. Moreover, this job would "call" the cache in background.
Fabien MARTY