php ecshop 清除缓存文件夹,解决ecshop清除缓存css样式没反应问题

部分浏览器例如谷歌或360等双核浏览器会对商城的css样式进行缓存,导致修改了css样式文件也没有更新。ecshop模板提供解决方法,修改后效果如下:

18648564ebb3cbbb6ec65cdb21850fb8.gif

解决方法:

修改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文件的缓存作用。

这是在主机或域名没有开启云加速前提下的修改,如果开了云加速,关闭或手动清除云加速。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值