Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2011 07:42
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Using beanstalks .revision file to assure that the latest CSS gets to the browsers when using aggressive caching
$content = file('/path/to/.revision');
//First line: $content[0];
<link rel="stylesheet" href="style.css?v=<?=REV?>">
Copy link

yatil commented Aug 22, 2011

Note: Actually it would be better to have the revision of the file itself, so that caching works properly. Alternatives are dates as a query string or in the filename.

Copy link

I was wondering what this file was! This is excellent, thanks for the gist, it will work perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment