>   foreach ($sizes as $sz) {
>         $get_result = $memcache->get('inclarr');
>         if(!empty($get_result)){
>                 $incl_array = unserialize($get_result);
>         }
>         else
>         {
>                 $get_result = file_get_contents($path.'/data/incl_'.
> $sz.'.ser');
>                 $memcache->set('inclarr', $get_result);
>                 $incl_array = unserialize($get_result);
>         }

Sorry I don't know how to solve your problem, but I see something
silly in this snippet (and the other foreach loops). You're either
retrieving many times the same object 'inclarr', that could as well be
retrieved before the loop (once), or you're not retrieving the right
element from the cache. In the else branch, when you're reading from
the filesystem, you're differentiatinf between files with the $sz
variable: the same should be done with the memcache element, I think.
I'm sorry if I didn't really understood your code and there is a
perfectly valid reason for what you did.

--
Andrea Baron
[email protected]
[email protected]

Reply via email to