outeredge/magento-module-cachebuster

outer/edge 开发的 Magento CacheBuster 模块

1.0.6 2017-05-17 10:22 UTC

This package is auto-updated.

Last update: 2024-09-14 19:31:04 UTC


README

在部署后为资源添加 md5 哈希值以实现缓存破坏。

mod_rewrite 配置

将以下重写规则添加到您的 .htaccess 文件中

<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)\.([0-9a-f]{32})\.(.+)$ $1.$3 [L]
</IfModule>

nginx 配置

将以下内容添加到您的服务器块中

location ~ "(.+)\.([0-9a-f]{32})\.(.+)$" {
    expires max;
    try_files $uri $1.$3 =404;
}