athlon1600/php-proxy-plugin-cache 问题修复 & 功能扩展

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

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

athlon1600/php-proxy-plugin-cache

Composer 安装命令:

composer require athlon1600/php-proxy-plugin-cache

包简介

Cache Plugin for PHP-Proxy

README 文档

README

Provides caching support for PHP-Proxy application. Cache Plugin as of this moment only supports memory storage.

Installation

Install Redis Server:

apt-get install redis-server

Start the server if not already started

/etc/init.d/redis-server start

Find the composer.json file in your proxy directory, and add this package as one of its requirements:

"require": {
	"athlon1600/php-proxy": "@dev",
	"athlon1600/php-proxy-plugin-cache": "@dev"
},

Install the new composer package:

composer update

Final step, find the config.php file in that same directory, and add Cache to the list of plugins to be loaded.

$config['plugins'] = array(
	'Cache', // <--- new plugin
	'HeaderRewrite',
	'Stream',
	.....
);

Cache plugin has to be loaded first, so must appear first in the list otherwise it won't work.

Redis Configuration

By default, Redis is configured to store everything it's being sent, however on a busy proxy that tends to overload the memory with all those caches files. For best performance, adjust redis memory settings and set appropriate key eviction policy. This should be good enough on a server with 1 GB ram:

root@uk1:/# redis-cli
127.0.0.1:6379> config set maxmemory 300000000
OK
127.0.0.1:6379> config set maxmemory-policy volatile-lru
OK
127.0.0.1:6379>

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-10