承接 daynnnnn/statamic-swr-cache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

daynnnnn/statamic-swr-cache

Composer 安装命令:

composer require daynnnnn/statamic-swr-cache

包简介

Allows you to add stale while revalidate functionality to the application static cache driver.

README 文档

README

Allows you to add stale while revalidate functionality to the application static cache driver.

Requirements

This add-on currently requires you to use Redis as a cache driver.

Additionally, you'll need to process queue items with a separate worker - if you're using the sync driver, this add-on won't have any effect.

Installation

From a standard Statamic V3 site, you can run:

composer require daynnnnn/statamic-swr-cache

Then you'll just need to add the stale while revalidate strategy to your static cache config:


'strategies' => [
    ...
    'swr' => [
        'driver' => 'swr',
        'expiry' => '60',
        'stale' => '5',
    ],
],

How it works

In the above example, cached pages will stay in the cache for 60 minutes (expiry), but if the cached page is accessed when the cache is over 5 minutes old (stale), a background job will run to update the cache, but the currently cached page will still be served.

Other than this, the cache will stay the same as the application cache.

统计信息

  • 总下载量: 145
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固