Webiny\Component\Rest\Response\Cache::purgeCacheResult PHP Method

purgeCacheResult() public method

Purges the cached result.
public purgeCacheResult ( ) : boolean
return boolean
    public function purgeCacheResult()
    {
        // get cache key
        $cacheKey = $this->getCacheKey();
        // cache the result
        try {
            $cache = $this->cache($this->requestBag->getApiConfig()->get('Cache'));
            return $cache->delete($cacheKey);
        } catch (\Exception $e) {
            throw new RestException('Unable to purge the result from cache. ' . $e->getMessage());
        }
    }