Code snippets for symfony 1.x

Navigation

Snippets tagged "cache database"

cache objects

This is a simple example for object cache.

$key = md5('myPropelObjectKey');
$sfProcessCache = new sfProcessCache();
if ($sfProcessCache->has($key)) {
  $obj = unserialize($sfProcessCache->get($key));
}else{
  $obj = Table::doSelect();
  $sfProcessCache->set($key, serialize($obj))
}
by Gordon Franke on 2006-10-30, tagged cache  database