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. 😉

[pastacode lang=”php” manual=”%3Clink%20rel%3D%22stylesheet%22%20href%3D%22%3C%3Fphp%20echo%20%24url.’%2Fstyle.css%3Fv%3D’.time()%3B%20%3F%3E%22%3E%0A%0A%3Cscript%20type%3D%22javascript%2Ftext%22%20src%3D%22%3C%3Fphp%20echo%20%24url.’%2Fjs%2Fcustom.js%3Fv%3D’.time()%3B%20%3F%3E%22%3E%3C%2Fscript%3E” message=”Simple Caching fix” highlight=”” provider=”manual”/]