开发者

Ideas for how to alter file-names of static assets to prevent out-dated browser cached versions of asset files

I have a website that I host with PHPFog. PHPFog, for those who don't know, makes it very easy to deploy an app to multiple application servers with a simple git-push. I would love it if there was some way to automatically update the version number of my javascript/css files with every git-commit or git-push. Or somehow maybe just append the 'build' unix timestamp to the filename. The goal of course to queue browsers to reloa开发者_JS百科d the asset file instead of going with the cached version. Does anyone know of a good way to do this?


You can append a bogus query string to your CSS files - such as

styles.css?<?php print $release; ?>

The release identifier can be anything you want - perhaps a timestamp, git hashref, or tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜