Jarves\Cache\Backend\AbstractCache::invalidate PHP Method

invalidate() public method

Marks a code as invalidate until $time.
public invalidate ( string $key, boolean | integer $time = null ) : boolean
$key string
$time boolean | integer
return boolean
    public function invalidate($key, $time = null)
    {
        if (!$time) {
            $time = microtime(true);
        }
        $result = $this->doSet('invalidate-' . $key, $time);
        return $result;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Deletes a distributed cache
  *
  * @param string $key
  */
 public function deleteDistributedCache($key)
 {
     $this->fastCache->delete($key);
     //whe need to invalidate this cache, so other jarves servers refresh their cache
     $this->distributedCache->invalidate($key);
 }