php - Zend data cache TTL not working -


i'm using zend_shm_cache functions fast storage of variables. problem cache doesn't seem cleared after ttl over. example:

zend_shm_cache_store( $key = 'test3', 'value', 2 ); foreach( range(1,5) $timer ){     sleep( 1 );     echo $timer.' - ' .zend_shm_cache_fetch( $key ).'<br/>'; } 

returns:

 1 - value 2 -  3 - value 4 - value 5 - value 

i expect cache empty after second second. can explain what's happening or propose solution?

i got answer in documentation of apcu:

after ttl has passed, stored variable expunged cache (on next request).

as code runs in 1 request cache never deleted when time has expired.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -