tccltd/tcc-cache-buster
Composer 安装命令:
composer require tccltd/tcc-cache-buster
包简介
TccCacheBuster Package
README 文档
README
This module automatically inserts a version number into the head links and head scripts you have on your pages. The version number is pulled from the applicaiton config.
return [ 'version' => '1.1.1', ];
This will lead to a head link like /css/my-css-file.1.1.1.css
If you don't specify a version number nothing happens so can be used in development and then the buildscript for a production environment can insert a config file into the applications config/autoload directory.
A minor addition needs to be made to the apache .htaccess file to allow this to work using ModRewrite...
# Capture version bumping of files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.([0-9]+\.[0-9]+\.[0-9]+)\.(js|css|png|jpg|gif)$ /$1.$3 [L]
(Note: With the above you can also version images but this module does not automatically do this).
Why do I need this?
If you web server is set to cache js/css files in a users browser and you release a new version the browser will pull files from cache rather than download new version from the server.
By altering the version number of the file requested the browser downloads a new version from the server when the files have changed.
tccltd/tcc-cache-buster 适用场景与选型建议
tccltd/tcc-cache-buster 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 61 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 05 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tccltd/tcc-cache-buster 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tccltd/tcc-cache-buster 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-05-21