diff --git a/app/Controllers/EpisodeCommentController.php b/app/Controllers/EpisodeCommentController.php index fbb3452fc7e1d7d393fbffd8fb3be2e1cb024f11..d0c46cf118bd927795a3721358e890e8a27c5ee5 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 c8830c160495adf18a77185ddf3353e83ee0f37b..d54d096612d59d73bc59ff9f46d3d60074e50dfc 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 fb0be902c947bf3f7a1a5ba2a82207f3a326ffdd..e58c7ab37ea473b4d84e9dcd4d6f0ff5f71c9ab2 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#*'); } }