Laravel 8 緩存

2021-07-19 10:13 更新

給指定磁盤開啟緩存功能,需要在該磁盤的配置項中直接添加 cache 配置項。 cache 配置內(nèi)容是以數(shù)組形式存在的,由緩存驅(qū)動名稱 store (譯者注:文檔原始描述文字 disk 與示例代碼中的 store 不一致,驗證代碼后的確應(yīng)該是 store ,故作此修改。)、 緩存過期時間 expire(單位:秒) ,以及緩存前綴 prefix 組成:

's3' => [
    'driver' => 's3',

    // Other Disk Options...

    'cache' => [
        'store' => 'memcached',
        'expire' => 600,
        'prefix' => 'cache-prefix',
    ],
],
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號