diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 9d4d262aa..7c1ad66b6 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -32,4 +32,12 @@ class Paths } return $datadir . "/" . $path; } + + function cache_buster($filepath) { + $fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath; + if (file_exists($fullpath)) { + return base_url($filepath) . '?v=' . filemtime($fullpath); + } + return base_url($filepath); + } }