App\Modules\Demos\Controllers\Demos::cache PHP Method

cache() public method

public cache ( )
    public function cache()
    {
        $key = "test_page";
        $content = Cache::get($key);
        if (is_null($content)) {
            $content = "Files Cache --> Well done !";
            // Write products to Cache in 10 minutes with same keyword
            Cache::put($key, $content, 10);
        } else {
            $content = "READ FROM CACHE // " . $content;
        }
        return View::make('Default')->shares('title', __d('demos', 'Cache'))->with('content', $content);
    }