Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Cache needs refactoring #319

Open
florianv opened this issue Dec 17, 2013 · 2 comments
Open

Cache needs refactoring #319

florianv opened this issue Dec 17, 2013 · 2 comments
Milestone

Comments

@florianv
Copy link
Contributor

There are a few issues with the Cache package :

Why not using Doctrine which has already more drivers and fixed most of these issues ?
https://github.com/doctrine/cache/tree/master/lib/Doctrine/Common/Cache

@piotr-cz
Copy link
Contributor

You might be interested in a discussion on Cache package in the past:
What to do with the Cache package and here.

BTW PSR-6 (Cache interface) is in the Draft stage, but I fear it may take some time to finalize.

@ghost
Copy link

ghost commented Jan 17, 2014

I'm not really thrilled with the implementation, but I will point out that wrapping values inside an object solves the issue of "is null or is not present" - the cache handler ALWAYS returns a cache object - and it will set a boolean flag to note if the value has been found or not.

Returning a cache item allows for the ability to add the cache meta data to the information returned[hits, misses, etc].

Moreover, it does allow for passing cached data around without making many copies..ie objects are always passed by reference.

I personally think that in addition to passing a cache item back, data should be stored as a cache item to begin with.

As for sessions, the Memcached session driver doesn't use a driver at all - it simply defaults to using the built in php functions... Again, not thrilled about this direction, however I think a much simpler solution is to create a CacheEngine class for the Session and allow the session driver to use any Joomla Cache method without requiring special code logic].

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants