定制 quinninteractive/silverstripe-clearkey 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

quinninteractive/silverstripe-clearkey

最新稳定版本:2.0.0

Composer 安装命令:

composer require quinninteractive/silverstripe-clearkey

包简介

Silverstripe module to manage partial-cache invalidation

README 文档

README

When using Silverstripe’s partial caching, the keys you use can usually be grouped into two types.

  1. Cache identifier keys, which help tell one cache block from another
  2. Cache clearing keys, which tell us when a block is stale

Take this partial-cache block as an example:

<% cached 'Promo', $ID, $Link, $Promo.LastEdited, $List('SiteTree').max('LastEdited'), $List('SiteTree').count() %>
...
<% end_cached %>

These identifier keys help tell one promo from another:

  • 'Promo'
  • $ID
  • $Link

These clearing keys help tell us when the content is stale:

  • Promo.LastEdited
  • $List('SiteTree').max('LastEdited')
  • $List('SiteTree').count()

Partial caches do a great job with identifier keys, but have to hit the database at every page load to calculate some of the clearing keys, especially the aggregation ones.

ClearKey solves this by letting you manage the calculating of clearing of stale data whenever a relevant data object is saved, instead of on every page load. With ClearKey, the example cache block might look like this:

<% cached $ClearKey('Promo'), $ID, $Link %>
...
<% end_cached %>

You define the clear keys with a corresponding config to describe which classes being updated should invalidate each key. In the example below, the Promo key is invaldated whenever a Promo or SiteTree is saved.

---
Name: clearkey-config
After:
  - '#corecache'
---
QuinnInteractive\ClearKey\Extensions\ClearKeyExtension:
  invalidators:
    Promo:
      - SilverStripe\App\Model\Promo
      - SilverStripe\CMS\Model\SiteTree
    AnotherKey:
      - SilverStripe\App\Model\Something
      - SilverStripe\CMS\Model\Etc

Current version: 2.0.0

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-10-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固