purge() public method

It's up to the implementor to decide whether to purge $locationIds right away or to delegate to a separate process.
public purge ( array $locationIds )
$locationIds array Cache resource(s) to purge (e.g. array of URI to purge in a reverse proxy)
 public function purgeForContent($contentId)
 {
     $contentInfo = $this->contentService->loadContentInfo($contentId);
     $event = new ContentCacheClearEvent($contentInfo);
     $this->eventDispatcher->dispatch(MVCEvents::CACHE_CLEAR_CONTENT, $event);
     $locationIds = [];
     foreach ($event->getLocationsToClear() as $location) {
         $locationIds[] = $location->id;
     }
     $this->purgeClient->purge(array_unique($locationIds));
 }
 /**
  * {@inheritdoc}
  */
 public function purgeForContent($contentId, $locationIds = [])
 {
     $contentInfo = $this->contentService->loadContentInfo($contentId);
     // Can only gather relevant locations using ContentCacheClearEvent on published content
     if ($contentInfo->published) {
         $event = new ContentCacheClearEvent($contentInfo);
         $this->eventDispatcher->dispatch(MVCEvents::CACHE_CLEAR_CONTENT, $event);
         foreach ($event->getLocationsToClear() as $location) {
             $locationIds[] = $location->id;
         }
     }
     $this->purgeClient->purge(array_unique($locationIds));
 }
 /**
  * Instantly triggers the cache purge of given $cacheElements.
  *
  * @param mixed $cacheElements
  *
  * @return mixed
  */
 public function purge($cacheElements)
 {
     $this->purgeClient->purge($cacheElements);
     return $cacheElements;
 }