Skip to content

Commit

Permalink
Fixes automatic cache flush
Browse files Browse the repository at this point in the history
  • Loading branch information
onefriendaday authored Apr 20, 2017
1 parent 5deee8b commit 081b93e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Storyblok/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,8 @@ public function flushCache()
*/
private function reCacheOnPublish($key)
{
if (isset($_GET['_storyblok_published']) && $this->cache && !$cachedItem = $this->cache->load($key)) {
if (isset($cachedItem['story']) && $cachedItem['story']['id'] == $_GET['_storyblok_published']) {
$this->cache->delete($key);
}
if (isset($_GET['_storyblok_published']) && $this->cache) {
$this->cache->delete($key);

// Always refresh cache of links
$this->cache->delete($this->linksPath);
Expand Down Expand Up @@ -655,4 +653,4 @@ private function _prepareOptionsForKey($options) {
array_push($prepared, join('', $keyOrder));
return $prepared;
}
}
}

0 comments on commit 081b93e

Please sign in to comment.