mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 20:17:46 +02:00
fix(cache): delete posts and comments pages cache when updating platform links
remove cache when adding comment and replies as well fixes #169
This commit is contained in:
parent
5bcdfebe64
commit
f7c3e5bf4a
3 changed files with 12 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ class EpisodeCommentController extends BaseController
|
||||||
'_',
|
'_',
|
||||||
array_filter([
|
array_filter([
|
||||||
'page',
|
'page',
|
||||||
|
"episode#{$this->episode->id}",
|
||||||
"comment#{$this->comment->id}",
|
"comment#{$this->comment->id}",
|
||||||
service('request')
|
service('request')
|
||||||
->getLocale(),
|
->getLocale(),
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,12 @@ class EpisodeCommentModel extends UuidModel
|
||||||
|
|
||||||
$this->db->transComplete();
|
$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;
|
return $newCommentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,5 +198,10 @@ class PlatformModel extends Model
|
||||||
// delete localized podcast page cache
|
// delete localized podcast page cache
|
||||||
cache()
|
cache()
|
||||||
->deleteMatching("page_podcast#{$podcastId}*");
|
->deleteMatching("page_podcast#{$podcastId}*");
|
||||||
|
// delete post and episode comments pages cache
|
||||||
|
cache()
|
||||||
|
->deleteMatching('page_post*');
|
||||||
|
cache()
|
||||||
|
->deleteMatching('page_episode#*');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue