Re: Conditional GET in Cache_Lite

From: Date: Wed, 03 Sep 2003 19:56:11 +0000
Subject: Re: Conditional GET in Cache_Lite
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21035@lists.php.net to get a copy of this message
Fabien MARTY wrote:
Stefan suggested that I talk to you about my code to support conditional GET with Cache_Lite. I can try to help port Cache_HTTP_Request into Cache_Lite and impliment conditional GET, if you'd like. Let me know if you've already got any thoughts or code on this, and we can see what can be done.
Porting HTTP_Request to Cache_Lite would be a really good thing. So feel free to add it to the CVS :) I have not particular thoughts about this port. conditional GET is an interesting idea but it has to be out of the HTTP_Request port. But maybe, I'm not clear (english isn't my first language). IMHO, porting HTTP_Request to Cache_Lite and implementing conditional GET are two separate things.
Just to make sure we're clear, when you say HTTP_Request, do you mean Cache_HTTP_Request, which is a child of Cache, or the HTTP_Request package? IIRC, Cache_HTTP_Request uses HTTP_Request to get the remote file and cache automatically. Personally, I think this is something that should be handled within Cache_Lite itself, not an extension of Cache_Lite (like Cache_Lite_HTTP_Request or something).
Regarding conditional GET, I would add it as a new method of Cache_Lite class or inside the get() method himself (but without changing the API !!!).
I agree.
Another way is to make a new class which extends Cache_Lite : Cache_Lite_Conditional and redefines the get() method. The choice depends on your code. Any advice about it ?
This is how it's done in Cache, but I would rather see it integrated directly into Cache_Lite. I think this could go either way, since things will have to be changed in either case to move it from Cache to Cache_Lite. The other issue that was brought up was what would happen to Cache_HTTP_Request. I wonder if it would be possible to somehow map Cache_HTTP_Request's API to Cache_Lite's HTTP features (however we decide to do it) so that we would only have to maintain one class, but existing Cache_HTTP_Request implimentations would still work. This would mean Cache would need a dependency on Cache_Lite, which would be weird... -- Marshall Roch

« previous php.pear.dev (#21035) next »