A
A
Alexander2016-07-29 17:06:45
PHP
Alexander, 2016-07-29 17:06:45

What is the correct way to implement CacheProvider?

I have two ideas on how my cacheProvider should work
1) Should provide a single API for working with different drivers (redis, memcached, files). In this case, the CacheProvider has a strict method set (set get exist flush update).
2) Must return the object of the required driver (one of the redis memcached files....).
Which method is more rational?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-07-29
@websiteserf

Of course, the first option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question