fruitcake / magento2-sitemap-warmer
Magento2 网站地图预热工具
v1.0-beta1
2023-10-05 13:30 UTC
Requires
- php: ^7.4|^8
- ext-json: *
- magento/framework: *
- magento/module-sitemap: *
- symfony/console: ^4|^5|^6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.34
This package is auto-updated.
Last update: 2024-09-11 09:53:28 UTC
README
如果你有一个网站地图,只需运行此命令即可预热你的页面。
安装
composer require fruitcake/magento2-sitemap-warmer
php bin/magento setup:upgrade
用法
定时任务不会自动运行。您可以手动将其添加到您的 crontab。
基本用法,使用 Magento 的网站地图并执行 100 次访问
php bin/magento sitemap:warm
特定网站地图
php bin/magento sitemap:warm https://example.com/sitemap.xml
特定网站地图
php bin/magento sitemap:warm https://example.com/sitemap.xml
仅包含优先级为 0.5 的 URL,每个请求之间暂停 1 秒,并执行 500 个 URL
php bin/magento sitemap:warm --priority=0.5 --sleep=1 --requests=500
我建议您在 crontab 中使用 flock 来避免重叠。
待办事项
- 在管理界面中添加定时任务调度/设置
- 使用 Magento 定时任务运行,避免重叠