-
-
Notifications
You must be signed in to change notification settings - Fork 45
[WIP] ApcuStorage: user cache from APC #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b0cec4c to
edafd15
Compare
a454794 to
edcd260
Compare
|
Nice, but 👎 for adding it to the repository, it's only rarely used. |
|
I have no problem with creating |
94699e9 to
0bdc213
Compare
0bdc213 to
9334640
Compare
|
ApcStorage was is Nette 4 year ago https://github.com/nette/outdated-addons/blob/master/ApcStorage/ApcStorage.php, but was removed due to some problems, but I can't remember… |
|
@dg so should I solve the issues with testing the storage and it will be accepted, or should I create new kdyby package? |
|
I remember that there were really serious problems, but I am unable to google it :-( |
|
In fact, I've also copied this class as is, to our codebase and deployed to production last night and also no problems. |
|
Probably it is related to apc.slam_defense and apc.write_lock. When slam defense is configurable, I am 👍 for merge. |
|
So are we now going to support every backend only few people use - like Redis, MySQL, NoSQL DBs etc.? |
|
I am 👍 for merge |
|
It is not possible to merge when tests are failing. |
|
I have very little time to work on it right now, but I'm planning to finish it. As always, if anybody wants to finish it and has the time, you're welcome to take over. |
|
ping @fprochazka |
2cf4e97 to
13418b9
Compare
|
@fprochazka @Majkl578 its pretty simple, really APC/APCu cache is based on HTTP(CLI) requests What the doc means by the stored variable will be expunged from the cache (on the next request) the cache is going to be expunged when the script is next run, so only solution is to run subprocess or something to get it working the cache is never gonna expire in long running process - but it shouldnt matter depending on what are you using the cache on perhaps sth like (i dont like but..): sleep(3);
$cmd = shell_exec('php loadExpiredKey.php');
Assert::equal($cmd, '1');loadExpiredKey.php: $cache = new Cache(new ApcuStorage());
echo $cache->load($key) == null; |
54c618b to
62a27d9
Compare
ec9e432 to
e07955b
Compare
492413c to
b0b475e
Compare
6037e83 to
1fe69cc
Compare
1655c0f to
7c885a2
Compare
29c60cc to
62bf8ec
Compare
|
ping @fprochazka |
92222cb to
077ab41
Compare
13f731f to
d7b0fb9
Compare

APC opcode caching might be dead, because the zend optimizer plus is now native for 5.5+,
but the APCu is still alive and thriving. And I think It's pretty good storage option for some types of cache. Therefore I propose adding new storage supporting it.
I've copied the tests from memcached and rewritten them for the new storage.
There is a problem - Apcu clears cache depending on TTL only when new request occurs - which means It cannot be easily tested. Any idea how to test it?
Or should I implement "fallback" expiration check that will store when the key should be expired and then expire it manually if neccesary?