On Thu, 10 Apr 2008, Tobias Schlitt wrote:

> On 04/10/2008 09:59 AM Derick Rethans wrote:
> > On Wed, 9 Apr 2008, Tobias Schlitt wrote:
> >> On 04/09/2008 02:13 PM Derick Rethans wrote:
> 
> >>> Sometimes you might not want the items stored in a higher stack level,
> >>> for example because of data size reasons. As an example, you want a 1mb
> >>> PDF file stored in a cache on disk, but definitely not in the memory
> >>> cache. How are we going to handle this?
> 
> >> You need to create a dedicated cache storage for these files.
> 
> > Why? I'm saying that this should be an option of every cache storage 
> > that we have. Creating a whole new storage backend for just doing this 
> > seems silly. I think it's particulary important for the memory caches 
> > (in-memory, apc, shared-mem).
> 
> It will overcomplicate the whole process, if you create such exceptions.
>  In fact you need to either check the size of the data to store
> (impossible inside PHP) or need to devide by attribute or something, in
> which levels an item might be stored. This also unnecessaty raises
> complexity of the storage process, which again reducec performance.
> 
> I also do not see a problem to create a dedicated storage for this. In
> fact you just need to create a new directory on your HD and instatiate
> the object. If you need such large items to be stored, you most probably
> want to store them on the HD anyway, so a dedicated storage that does
> not involve the overhead of the stack is desired here.

The problem of having a dedicated storage stack is that the application 
then needs to start caring about in which storage stack to store a 
specific file. I think you might be missing that I meant that in the 
same storage for cache items, *some* of the items are going to be too 
big. For example you're storing generated PDFs where most of them are 
100kb and a few others 10MB. Here you might not want the complexity of 
having the application itself do this check as it might complicate the 
application too much. 

I don't see how it is impossible to figure out the size of the data to 
store btw.

> >>>>     interface ezcCacheStackableStorage
> >>>>     {
> >>>>         restoreMetaInfo();
> >>>>         storeMetaInfo( array $metaInfo );
> >>>>
> >>>>         purge();
> 
> >>> Maybe we can add an option to purge() to clear out the whole cache?
> 
> >> I would suggest to add another method for this, named empty() or something.
> 
> > You can't really use empty() though, as it's most likely a reserved 
> > keyword.
> 
> What about clean()?

Sure.

regards,
Derick
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to