We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

File system cache too slow?

Hello,

my code:

var_dump($cacheAdapter, $cacheKey, $select);
$cacheAdapter->save($cacheKey, $select);
var_dump($cacheAdapter->get($cacheKey));
die;

Output:

object(Phalcon\Cache\Backend\File)[43]
  protected '_frontend' => 
    object(Phalcon\Cache\Frontend\Data)[41]
      protected '_frontendOptions' => 
        array (size=1)
          'lifetime' => int 10
  protected '_options' => 
    array (size=2)
      'prefix' => string 'sCMS' (length=4)
      'cacheDir' => string '/data/www/vhosts/kcentras/var/cache/long/' (length=41)
  protected '_prefix' => string 'sCMS' (length=4)
  protected '_lastKey' => string 'sCMSModules-registerAutoloaders-path.cache' (length=42)
  protected '_lastLifetime' => null
  protected '_fresh' => boolean false
  protected '_started' => boolean false

string 'Role-getSelect-select.cache' (length=27)

array (size=1)
  1 => string 'Administratorius' (length=16)

null

Xcache output:

object(Phalcon\Cache\Backend\Xcache)[43]
  protected '_frontend' => 
    object(Phalcon\Cache\Frontend\Data)[41]
      protected '_frontendOptions' => 
        array (size=1)
          'lifetime' => int 10
  protected '_options' => 
    array (size=2)
      'prefix' => string 'sCMS' (length=4)
      'statsKey' => string '_PHCX' (length=5)
  protected '_prefix' => string 'sCMS' (length=4)
  protected '_lastKey' => string '_PHCXsCMSModules-registerAutoloaders-path.cache' (length=47)
  protected '_lastLifetime' => null
  protected '_fresh' => boolean false
  protected '_started' => boolean false

string 'Role-getSelect-select.cache' (length=27)

array (size=1)
  1 => string 'Administratorius' (length=16)

array (size=1)
  1 => string 'Administratorius' (length=16)

Is file system cache too slow or is it the issue?



98.9k
edited Nov '14

What conclusions lead you to think that it is slow?, I can't see any benchmarks in your post

I think I just asked for a wrong question. Actually I want to know why I'm getting null in my code 3rd line if I use filesystem cache?