承接 marvin255/in-memory-cache 相关项目开发

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

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

marvin255/in-memory-cache

Composer 安装命令:

composer require marvin255/in-memory-cache

包简介

Array based cache for PHP

关键字:

README 文档

README

Build Status

Simple PSR-16 implementation that uses an internal array to store data.

Usage

use Marvin255\InMemoryCache\InMemoryCache;

$maxCacheSize = 10000;  // only 10000 can be stored by this object
$defaultTTL = 60;       // 60 seconds as default TTL

$cache = new InMemoryCache($maxCacheSize, $defaultTTL);

Decorator

The decorator allows you to use two caches at the same time. All data from the base cache (e.g. a Redis-based cache) will also be stored in InMemoryCache. This decorator can reduce the number of requests for long-running PHP processes.

use Marvin255\InMemoryCache\InMemoryCache;
use Marvin255\InMemoryCache\CompositeCache;

$maxCacheSize = 10000;  // only 10000 can be stored by this object
$defaultTTL = 60;       // 60 seconds as default TTL

$inMemoryCache = new InMemoryCache($maxCacheSize, $defaultTTL);
$redisCache = new MyAwesomeRedisCache();
$decorator = new CompositeCache($inMemoryCache, $redisCache);

$decorator->get('test'); // this call will trigger a request to Redis and save the data to memory
$decorator->get('test'); // this call won't trigger any requests and will just return data from memory

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固