weakbit/lucene-cache
Composer 安装命令:
composer require weakbit/lucene-cache
包简介
Provides a cache backend for TYPO3 that stores all cache information in Lucene
README 文档
README
Provides a cache backend for TYPO3 that stores all cache information in Lucene index.
Key Features of lucene-cache for TYPO3
- Efficient Caching: Uses Lucene's indexing and search capabilities to store and retrieve cached content quickly.
- Scalability: Can handle large volumes of data and perform well under high load, making it suitable for large TYPO3 installations.
- Flexibility: Provides flexible configuration options to tailor the caching behavior to specific needs.
- Integration: Seamlessly integrates with TYPO3's caching framework, allowing for easy setup and use within TYPO3 projects.
Installation and Configuration
To use the lucene-cache backend in your TYPO3 project, follow these steps:
Install the Extension
You can install the lucene-cache extension via Composer:
composer require andersundsehr/lucene-cache
Example Configuration for the Cache
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages'] = [ 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class, 'backend' => \Weakbit\LuceneCache\Cache\Backend\LuceneCacheBackend::class, 'options' => [ 'defaultLifetime' => 604800, 'maxBufferedDocs' => 1000, 'compression' => true, 'compressionAlgorithm' => 'zstd', // optional: auto-detects if not set 'compressionMinSize' => 256, // optional: skip compression for small data ], 'groups' => [ 'pages', ] ];
Performance
The issue to develop that cache was a usage of very many cache tags.
maxBufferedDocs is set to 1000 here, that means that up to 1000 documents are buffered before to write, that is good for large imports if you have some spare ram. Meanwhile, that caching information is not available to other PHP processes.
Keep in mind that some operations (flushes and garbage collection) will always commit the buffer first to have a full index to search in.
compression
Enable compression to reduce disk space usage. The extension supports multiple compression algorithms and will auto-detect the best available one.
'options' => [ 'compression' => true, 'compressionAlgorithm' => 'zstd', // 'zstd', 'gzdeflate', or 'gzcompress' 'compressionLevel' => 3, // -1 to 9 (default: -1 = auto) 'compressionMinSize' => 256, // minimum bytes to compress (default: 256) ],
Available algorithms (in order of preference):
| Algorithm | Speed | Ratio | Requirement |
|---|---|---|---|
zstd |
⚡ Fast | Excellent | ext-zstd |
gzdeflate |
Medium | Good | ext-zlib |
gzcompress |
Medium | Good | ext-zlib |
- Auto-detection: If
compressionAlgorithmis not set, the best available algorithm is used automatically. - Minimum size: Data smaller than
compressionMinSizebytes is not compressed (overhead not worth it). - Backward compatible: Existing caches using legacy
gzcompresswill still decompress correctly.
For more detailed information, refer to the following resources:
Lucene-cache GitHub Repository
TYPO3 Documentation on Caching Framework
These resources provide comprehensive documentation and examples to help you get started with the lucene-cache backend for TYPO3.
Credits
This extension is inspired by Benni Mack's bmack/local-caches
weakbit/lucene-cache 适用场景与选型建议
weakbit/lucene-cache 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.13k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 weakbit/lucene-cache 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 weakbit/lucene-cache 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-05-10