switon/http-cache
最新稳定版本:v1.0.0
Composer 安装命令:
composer require switon/http-cache
包简介
HTTP response caching filter for Switon Framework
README 文档
README
HTTP response caching filter for Switon Framework.
Installation
composer require switon/http-cache
Requirements: PHP 8.3+
Quick Start
use Switon\Http\RequestInterface; use Switon\HttpCache\Attribute\PageCache; use Switon\Routing\Attribute\GetMapping; class ProductController { #[GetMapping('/products')] #[PageCache(ttl: 600, key: ['category', 'page'])] public function listAction(RequestInterface $request): array { $category = $request->get('category', 'all'); $page = (int)$request->get('page', 1); return [ 'category' => $category, 'page' => $page, 'items' => $this->loadProducts($category, $page), ]; } }
Docs: https://docs.switon.dev/latest/http-cache
License
MIT.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-10