ordent/cache-url-redis 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ordent/cache-url-redis

Composer 安装命令:

composer require ordent/cache-url-redis

包简介

AIO Cache Management based on URL and Auth Implementation

README 文档

README

AIO cache management service based on URL and Auth JWT Implementation.

How To Use

  1. Install the package via composer
composer require ordent/cache-url-redis
  1. Implement the providers in your app configurations at config/app.php
'providers' => [
  Ordent\CacheURLRedis\Providers\URLCacheProvider::class
]
  1. Add a constant in the start of your bootstart/app.php to measure the execution time of your api.
define('EXEC_TIME_START', microtime(true));
  1. Add our middleware in App\Http\Kernel to short circuit the computation process to redis when the URL key is found.
protected $middleware = [
  Ordent\CacheURLRedis\Middleware\URLCacheMiddleware::class
]
  1. Don't forget to set up your CACHE env implementation.
  CACHE_DRIVER=redis

Output

  1. We measure and deliver the endpoint execution time via response header X-Elapsed-Time.
  2. You need to send a Header in order to use the caching mechanism. If the header is not found on the request, the request will be computed normally. The header you need to set is X-Cache-URL with either value of with-auth or without-auth.
  3. When the value without-auth is being used, the application will short circuit the computation process to Redis with finding the key of request URL.
  4. However if the value with-auth is used, the application will use the Redis with key format : {application-url}:{authorization-header-value} with authorization-header-value is your JWT token with Bearer format removed.
  5. As of now the cache will last 60 minutes and won't cache another value unless you use header X-Cache-URL-Invalidate, you can use it to invalidate the cache value after transaction or any other database change.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固