jvmtech/warmupcache
Composer 安装命令:
composer require jvmtech/warmupcache
包简介
Wormup Neos CMS full static cache or fusion caches by crawling selected urls or websites.
README 文档
README
Warm up your website's cache by crawling URLs or sitemaps, and include lists of allowed and denied patterns.
Installation
composer require jvmtech/warmupcache
How to use it?
By default the specified urls/sitemaps will be just scanned. To be able to warmup all crawled urls the Queue need to be set up.
flow queue:setup warmupcache
Then execute one of described below commands with --add-to-queue parameter to add URLs to queue.
The last step is queue execution. You can do it standard way executing one job after another:
./flow job:work warmupcache
watch ./flow queue:list # wait until warmupcache is zero
or you can use parallel execution like below (keep in mind that in this case you need to specify right limit (amount of jobs in queue divided by amount of processes you will use))
seq 4 | xargs -I{} -P4 sh -c "FLOW_CONTEXT=Your/Context ./flow job:work warmupcache --limit 100 --verbose"
Commands
cachewarmup:extracturls - crawling URL(s) to extract all hrefs.
Useful when we would like to cherry-pick which pages/subpages would be warmed up like for example subpages of product page. Example usage (scanning 3 home page variants)
./flow cachewarmup:extracturls --urls=https://your.site/ch-de/institutional,https:/your.site/ch-de/pro,https://your.site/ch-de/private --add-to-queue
cachewarmup:extracturlsfromsitemap - crawling sitemap to extract hrefs.
Useful when we would like to warmup most pages from the sitemap. Example usage:
./flow cachewarmup:extracturlsfromsitemap --sitemaps=https://your.site/ch-de/pro/sitemap.xml --add-to-queue
./flow cachewarmup:extracturlsfromsitemap --preset=homepage
Presets configuration
Both commands can be used with --preset <preset_name> parameter and use predefined settings that includes:
- urls/sitemaps list,
- allow list / deny list
- limits (how many pages should be loaded)
- additional urls settings (sufixes that would be added to pages matching specified pattern)
JvMTECH:
WarmupCache:
basicauth:
# login: ''
# pass: ''
presets:
# Example #1
# We want to warmup only subpages that are linked to from home page
# as we don't want to scan all insights or news
# skipping mailto & _Resources links
'homepage':
urls:
- 'https://your.site/ch-de/pro/'
- 'https://your.site/ch-de/private/'
allowlist:
# if values specified only pages matching pattern will be whitelisted
denylist:
- '/mailto\:/i' # to exclude all "mailto:" links
- '/\/_Resources\//i' # to exclude links containing "_Resources"
# limit: 0
# Example #2
# Each shareclass page has 3 functional subpages that are not in sitemap,
# but we want to have them cached - check addUrls section
'products':
sitemaps:
- 'https://your.site/ch-de/pro/sitemap.xml'
- 'https://your.site/ch-de/private/sitemap.xml'
allowlist:
- '/\/products\//i'
denylist:
limits: 0,0 # for each sitemap separated with comma (,)
addUrls: # links finishing with -currencySymbol are extended with subpages
'/prices.json': '/(-usd|-eur|-chf|-gbp)$/i'
'/productdocuments': '/(-usd|-eur|-chf|-gbp)$/i'
'/productdocumentssimple': '/(-usd|-eur|-chf|-gbp)$/i'
by jvmtech.ch
jvmtech/warmupcache 适用场景与选型建议
jvmtech/warmupcache 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 362 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jvmtech/warmupcache 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jvmtech/warmupcache 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 362
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-25