ivoba/buzzle

该软件包最新版本(1.0.0)没有可用的许可证信息。

1.0.0 2014-12-19 09:41 UTC

This package is auto-updated.

Last update: 2024-09-10 21:39:16 UTC


README

Buzz 扩展 Buzz

目前扩展了 Buzz 浏览器并添加了 DoctrineCache 缓存层。

Build Status Total Downloads

###安装

composer update ivoba/buzzle

###使用

$browser = new Buzzle/Browser();
$browser->setCacher(new Doctrine/Common/Cache/PhpFileCache($cacheDir), new Buzzle/Validators/CacheValidator());
$browser->call($url, $method, $headers, $content, $cacheLifetime);

###功能

  • 支持多种缓存后端,如文件系统、redis、memcached 等,归功于 DoctrineCache。
  • 仅缓存 GET 或 HEAD 请求。
  • 仅缓存有效的 HTTP 响应状态码('200', '203', '204', '205', '300', '301', '410')。
  • 如果来自缓存,则向响应添加 X-Buzzle-Cache: fresh 头部。
  • 处理 CacheControl 头部。
  • 可以强制忽略 CacheControl 头部: $Validator->setForceCache(true);

###待办事项

  • 单元测试!

###免责声明

###许可证 MIT