mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat(cache): update cache expiration times
- Update the cache expiration time for 'championsListAllCache' and 'championsRolesCache' to 8 hours.
- Update the cache expiration time for 'championShowCache{slug}' to 3 days.
- Update the cache expiration time for 'championSplashColorCache{slug}' to 6 months.
- Update the cache expiration time for 'championSkinShowCache{slug}' to 48 hours.
- Update the cache expiration time for 'championSkinSplashColorCache{slug}' to 120 hours.
This commit is contained in:
@@ -45,14 +45,14 @@ class ChampionController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show(Champion $champion)
|
public function show(Champion $champion)
|
||||||
{
|
{
|
||||||
$eightHoursInSeconds = 60 * 60 * 8;
|
$threeDaysInSeconds = 60 * 60 * 24 * 3;
|
||||||
$dayInSeconds = 60 * 60 * 24;
|
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6;
|
||||||
|
|
||||||
$champion = Cache::remember('championShowCache' . $champion->slug, $eightHoursInSeconds, static fn () => $champion->load('skins', 'lanes'));
|
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn() => $champion->load('skins', 'lanes'));
|
||||||
|
|
||||||
$splashColor = Cache::remember(
|
$splashColor = Cache::remember(
|
||||||
'championSplashColorCache' . $champion->slug,
|
'championSplashColorCache' . $champion->slug,
|
||||||
$dayInSeconds,
|
$sixMonthsInSeconds,
|
||||||
static fn() => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
|
static fn() => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -56,13 +56,13 @@ class ChampionSkinController extends Controller
|
|||||||
{
|
{
|
||||||
$skin = Cache::remember(
|
$skin = Cache::remember(
|
||||||
'championSkinShowCache' . $championSkin->slug,
|
'championSkinShowCache' . $championSkin->slug,
|
||||||
60 * 60 * 8,
|
60 * 60 * 48,
|
||||||
static fn() => $championSkin->load('champion', 'chromas')
|
static fn() => $championSkin->load('champion', 'chromas')
|
||||||
);
|
);
|
||||||
|
|
||||||
$splashColor = Cache::remember(
|
$splashColor = Cache::remember(
|
||||||
'championSkinSplashColorCache' . $championSkin->slug,
|
'championSkinSplashColorCache' . $championSkin->slug,
|
||||||
60 * 60 * 24,
|
60 * 60 * 120,
|
||||||
static fn() => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
|
static fn() => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user