webscale-networks/magento-cache-exclusions

magento2的查询字符串缓存排除扩展。

1.0.2 2024-07-24 17:23 UTC

This package is not auto-updated.

Last update: 2024-09-19 16:08:22 UTC


README

允许设置和配置Cache Exclusions Magento扩展。

安装

要安装扩展 - 在magento根目录下开始以下操作以添加仓库

composer config repositories.webscale-cache-exclusions git https://github.com/webscale-networks/magento-cache-exclusions.git

为了避免与CI/CD和github的问题,将"no-api": true添加到仓库设置中,使其看起来像这样

"webscale-cache-exclusions": {
    "type": "git",
    "url": "https://github.com/webscale-networks/magento-cache-exclusions.git",
    "no-api": true
}

现在需要安装扩展本身

composer require webscale-networks/magento-cache-exclusions

Composer安装完包后,运行以下magento命令

php bin/magento module:enable Webscale_CacheExclusions
php bin/magento setup:upgrade
bin/magento cache:clean

扩展安装后,可以在Admin > Stores > Configuration > Webscale > Cache Exclusions中进行配置

Webscale Cache Exclusions Configuration

要排除查询字符串中的任何节点,只需将其添加到参数列表中。

示例

在以下URL中

https://example.com/category/?utm_user=5c60ba87dbe4ea20747ddb6dad0f0a32d1d2d5ae&utm_source=Some+UTM+Source&utm_campaign=My+Campaign

唯一部分是:utm_user=5c60ba87dbe4ea20747ddb6dad0f0a32d1d2d5ae。要从magento缓存查找中排除它,请将utm_user添加到排除列表中,它将从缓存查找和哈希中删除整个节点,包括值

https://example.com/category/?utm_source=Some+UTM+Source&utm_campaign=My+Campaign