【ecshop清除缓存文件】ecshop清除缓存css样式不起作用解决办法

更新时间:2020-10-16    来源:php常用代码    手机版     字体:

【www.bbyears.com--php常用代码】

解决方法:

修改includes/init.php

找到

 代码如下

if (!empty($_CFG["stylename"]))
{
    $smarty->assign("ecs_css_path", "themes/" . $_CFG["template"] . "/style_" . $_CFG["stylename"] . ".css");
}
else
{
    $smarty->assign("ecs_css_path", "themes/" . $_CFG["template"] . "/style.css");
}

修改为:

 代码如下

if (!empty($_CFG["stylename"]))
{
    $smarty->assign("ecs_css_path", "themes/" . $_CFG["template"] . "/style_" . $_CFG["stylename"] . ".css?".time());
}
else
{
    $smarty->assign("ecs_css_path", "themes/" . $_CFG["template"] . "/style.css?".time());
}

修改后,style.css后面将自动添加时间标识,后台清除缓存都将自动更改这时间标识,达到清除浏览器对css文件的缓存作用。

本文来源:http://www.bbyears.com/jiaocheng/105039.html