I am having serious problems with Memcache.
Whenever I request a cache from the server, it always returns the same one, regardless of which one I call, if I clear the server memcache and go to a different page, it returns the correct result, but then that result is cached (When it should be returning the results of already cached pages).
The method is used in exactly the same way on other parts of the site, and yet it works perfectly and as it should.
I cannot post source code as it is a closed source project, sorry.
Thanks in advance.
Memcache returning incorrect items.
Moderator: General Moderators
Re: Memcache returning incorrect items.
Since you can't post the code it's quite hard to identify the problem right away. I'd suggest inspecting memcache network traffic to see if the key is really updated. Another pitfall could be that you use memcache_add() instead of memcache_set(). Also, reading the source of ZF's memcache adapter it seems some memcache/memcache extension versions incorrectly treated 'set' requests as 'add's - there's a workaround for this issue in ZF's source.
Re: Memcache returning incorrect items.
Well, thanks for that advice, they were all using set.
However the problem one another dev had altered the framework we use so that it caches certain parts of the page, and it calls the cache before the function call...
Bit of a stupid addition but i've sorted out a workaround accordingly.
Thanks for the advice though.
However the problem one another dev had altered the framework we use so that it caches certain parts of the page, and it calls the cache before the function call...
Bit of a stupid addition but i've sorted out a workaround accordingly.
Thanks for the advice though.