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.
精彩评论