CacheHelper.php 574 Bytes
Newer Older
1
2
3
4
<?php

namespace App;

Dominik Hebeler's avatar
Dominik Hebeler committed
5
6
use Illuminate\Support\Facades\Redis;

7
8
9
10
11
12
13
14
15
16
class CacheHelper
{

    /**
     * MetaGer uses a pretty slow harddrive for the configured cache
     * That's why we have some processes running to write cache to disk in parallel
     */
    public static function put($key, $value, $timeSeconds)
    {
        $cacherItem = [
Dominik Hebeler's avatar
Dominik Hebeler committed
17
            'timeSeconds' => $timeSeconds,
18
19
20
            'key' => $key,
            'value' => $value,
        ];
21
        Redis::rpush(\App\Console\Commands\RequestCacher::CACHER_QUEUE, base64_encode(serialize($cacherItem)));
22
23
24

    }
}