diff --git a/app/Controllers/EpisodeCommentController.php b/app/Controllers/EpisodeCommentController.php index fbb3452f..d0c46cf1 100644 --- a/app/Controllers/EpisodeCommentController.php +++ b/app/Controllers/EpisodeCommentController.php @@ -87,6 +87,7 @@ class EpisodeCommentController extends BaseController '_', array_filter([ 'page', + "episode#{$this->episode->id}", "comment#{$this->comment->id}", service('request') ->getLocale(), diff --git a/app/Models/EpisodeCommentModel.php b/app/Models/EpisodeCommentModel.php index c8830c16..d54d0966 100644 --- a/app/Models/EpisodeCommentModel.php +++ b/app/Models/EpisodeCommentModel.php @@ -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; } diff --git a/app/Models/PlatformModel.php b/app/Models/PlatformModel.php index fb0be902..e58c7ab3 100644 --- a/app/Models/PlatformModel.php +++ b/app/Models/PlatformModel.php @@ -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#*'); } }