Maybe 'clearing cache' is not as easy as it should be. As a fail-over, if that file doesn't exist, the year and week number are used so that caching still works, and it will be refreshed at least once a week.Īlso, this provides cache busting for every page load while in the development environment so that developers don't have to worry with clearing the cache for any resources (javascript, css, ajax calls, etc). This works by URL encoding that file and using that as a cache buster. Our publishing process generates a file with the revision number of the current build. Use today's year and week number to still have caching and busting
? urlencode( file_get_contents($versionFile) ) $this->view->cacheBust = file_exists($versionFile) $this->view->cacheBust = microtime(true) Here's a snippet of what I'm using for my latest project.