Closed JoJota closed 8 years ago
For caching with redis, you need to write a class implementing \Leaguewrap\CacheInterface.php
and then pass an instance of that class to the api (If you give the api a cache instance, it will use this for caching instead of its own memcached implementation).
You should have a look at \Leaguewrap\Cache.php
and how it implements CacheInterface
to communicate with Memcached as a reference.
Feel free to share your result. Im interested in caching with redis as well :)
Can someone give me an example of how external caching works (especially with redis)? I have set up a redis server and connected with predis. I am able to execute the following example:
But how can I implement this in Leaguewrap? What type of variable does $myCache have to be?
$api->remember(60, $myCache);
I am still learning PHP, so any help would be very much appreciated.