避免浏览器缓存更新

After reading this question I was wondering if I could prevent browser cache by appending my application version to the uri at the top of my index file.... like so:

$revision = getRevision();
if($_GET['v'] != $revision){
  header('Location: index.php?v=' . $revision);
}

Will this work?

The end goal is to reset the entire cache - JavaScript, CSS, images - when i push an update in, perferably, a nice little one liner

查看全部
doujiao2443
doujiao2443
2010/12/18 19:18
  • php
  • html
  • browser-cache
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复