April 13, 2017

Simple trick to get around WordPress Caching plugins Caching your dev files

If you’re like me and enjoy the ass clenching thrill of working on a live site without a testing server, sometimes caching plugins can be a real hassle. Get around this by adding a little dynamic date versioning to your non-cachable files. Like CSS and custom JS files.

Don’t say Uncle Dave doesn’t love you. 😉

<link rel="stylesheet" href="<?php echo $url.'/style.css?v='.time(); ?>">

<script type="javascript/text" src="<?php echo $url.'/js/custom.js?v='.time(); ?>"></script>
Simple Caching fix