承接 sylweriusz/webcache-middleware 相关项目开发

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

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

sylweriusz/webcache-middleware

Composer 安装命令:

composer require sylweriusz/webcache-middleware

包简介

Static aka Html pages cache for Slim3 middleware stack

README 文档

README

Static pages cache for Slim3 middleware stack

WebCache will save only GET request with status 200.

Install

$ composer require sylweriusz/webcache-middleware

Usage

Declare middleware

$app->add(new \Slim\Middleware\WebcacheRedis('192.168.1.12:6379'));

Cache will try to detect ID of document, first numerical value in url parts.

Example: http://example.org/article/123456/title.html after detection ID = 123456

and if it fail to detect it will assume ID = 0

if You want to delete all articles with this ID You should do something like this

$webcache = new \Slim\Middleware\WebcacheRedis('192.168.1.12:6379');
$webcache->delete(123456);

Disabling cache inside application route

\Slim\Middleware\WebcacheRedis::setTtl(0);

Change default TTL (in seconds) inside application route

\Slim\Middleware\WebcacheRedis::setTtl(600);

Smarty plugin

Define parts of html that should be always fresh, no mather what.

<body>
<div class="right-content">
{fresh id="reusable_box"}some html content{/fresh}
</div>

You can even declare them empty (as readonly) on another page and hope it will just work.

<body>
<div class="right-content">
{fresh id="reusable_box" readonly=1}{/fresh}
</div>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固