Skip to content

thinkcache

Joe Huss edited this page Nov 10, 2022 · 1 revision

ThinkCache

InstallThinkCache

composer require psr/container ^1.1.1 webman/think-cache

webman/think-cache This is actually an automated installation of the toptink/think-cache plugin。

configuration file

Configuration file for config/thinkcache.php

Usage

<?php
namespace app\controller;
  
use support\Request;
use think\facade\Cache;

class UserController
{
    public function db(Request $request)
    {
        $key = 'test_key';
        Cache::set($key, rand());
        return response(Cache::get($key));
    }
}

Think-CacheUsing the documentation

ThinkCacheDocument Address

Clone this wiki locally