mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 03:06:43 +02:00
fix(cache): add locale for podcast and episode pages + clear some persisting cache in models
fixes #42, #61
This commit is contained in:
parent
a354940e5e
commit
9cec8a81cc
6 changed files with 209 additions and 106 deletions
|
|
@ -44,11 +44,10 @@ class Episode extends BaseController
|
|||
{
|
||||
self::triggerWebpageHit($this->episode->podcast_id);
|
||||
|
||||
if (
|
||||
!($cachedView = cache(
|
||||
"page_podcast{$this->episode->podcast_id}_episode{$this->episode->id}"
|
||||
))
|
||||
) {
|
||||
$locale = service('request')->getLocale();
|
||||
$cacheName = "page_podcast{$this->episode->podcast_id}_episode{$this->episode->id}_{$locale}";
|
||||
|
||||
if (!($cachedView = cache($cacheName))) {
|
||||
$previousNextEpisodes = (new EpisodeModel())->getPreviousNextEpisodes(
|
||||
$this->episode,
|
||||
$this->podcast->type
|
||||
|
|
@ -64,7 +63,7 @@ class Episode extends BaseController
|
|||
// The page cache is set to a decade so it is deleted manually upon podcast update
|
||||
return view('episode', $data, [
|
||||
'cache' => DECADE,
|
||||
'cache_name' => "page_podcast{$this->episode->podcast_id}_episode{$this->episode->id}",
|
||||
'cache_name' => $cacheName,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue