Skip to content

Instantly share code, notes, and snippets.

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 steveosoule/c794fb45a9b2fc747439de1e64bd015d to your computer and use it in GitHub Desktop.
Save steveosoule/c794fb45a9b2fc747439de1e64bd015d to your computer and use it in GitHub Desktop.
Miva - CSS & JS Cache Busting with Modification Time
<mvt:comment>
Style Sheet Cache Busting on Modification Time
</mvt:comment>
<mvt:assign name="l.settings:css_file:path" value="'/mm5/' g.theme_path $ '/css/pages.css'" />
<mvt:assign name="l.settings:css_file:modified_time" value="stime( l.settings:css_file:path )" />
<mvt:assign name="l.settings:css_file:path_with_cache_buster" value="l.settings:css_file:path $ '?v=' $ l.settings:css_file:modified_time" />
<link rel="stylesheet" href="&mvt:css_file:path_with_cache_buster;">
<mvt:comment>
JavaScript Cache Busting on Modification Time
</mvt:comment>
<mvt:assign name="l.settings:js_file:path" value="'/mm5/' g.theme_path $ '/js/scripts.js'" />
<mvt:assign name="l.settings:js_file:modified_time" value="stime( l.settings:js_file:path )" />
<mvt:assign name="l.settings:js_file:path_with_cache_buster" value="l.settings:js_file:path $ '?v=' $ l.settings:js_file:modified_time" />
<script src="&mvt:js_file:path_with_cache_buster;"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment