Skip to content
Snippets Groups Projects
Commit f7c3e5bf authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(cache): delete posts and comments pages cache when updating platform links

remove cache when adding comment and replies as well

fixes #169
parent 5bcdfebe
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,7 @@ class EpisodeCommentController extends BaseController
'_',
array_filter([
'page',
"episode#{$this->episode->id}",
"comment#{$this->comment->id}",
service('request')
->getLocale(),
......
......@@ -122,6 +122,12 @@ class EpisodeCommentModel extends UuidModel
$this->db->transComplete();
// delete podcast and episode pages cache
cache()
->deleteMatching('page_podcast#' . $comment->episode->podcast_id . '*');
cache()
->deleteMatching('page_episode#' . $comment->episode_id . '*');
return $newCommentId;
}
......
......@@ -198,5 +198,10 @@ class PlatformModel extends Model
// delete localized podcast page cache
cache()
->deleteMatching("page_podcast#{$podcastId}*");
// delete post and episode comments pages cache
cache()
->deleteMatching('page_post*');
cache()
->deleteMatching('page_episode#*');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment