Frontend Module Updates - Fixes and data caching

This commit is contained in:
Leonard Biano
2024-09-11 20:16:02 +08:00
parent c191a9039a
commit d0184528aa
9 changed files with 49 additions and 15 deletions
@@ -11,6 +11,7 @@ use Modules\Frontend\Facades\Videos;
use Modules\Frontend\Services\Creators;
use Modules\Frontend\Services\Sections;
use Modules\Frontend\Services\Settings;
use Illuminate\Support\Facades\Cache;
class FrontendController extends Controller
{
@@ -40,8 +41,9 @@ class FrontendController extends Controller
public function video(Request $request, Video $video)
{
$locale = 'en';
$video->load(['thumbnail', 'ottData.links']);
$video = Cache::remember('ott_video_' . $video->id, 60 * 60, function () use ($video) {
return $video->load(['thumbnail', 'ottData.links']);
});
return view('frontend::video', compact('video'));
}