Skip to content

Instantly share code, notes, and snippets.

@mike-zarandona
Created January 13, 2014 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-zarandona/8408839 to your computer and use it in GitHub Desktop.
Save mike-zarandona/8408839 to your computer and use it in GitHub Desktop.
Adding this bit of PHP to the end of a stylesheet or script incorporation will dynamically append the UTC time to the URL - making it "unique" on every load. EXTREMELY helpful for clients who might not know how to clear their browser cache.
<link rel="stylesheet" type="text/css" href="path/to/stylesheet.css?r=<?php echo time(); ?>" />
<script type="text/javascript" href="path/to/javascript.js?r=<?php echo time(); ?>"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment