How to force browsers to reload cached CSS and JS files?

This solution is written in PHP, but it should be easily adapted to other languages. The original .htaccess regex can cause problems with files like json-1.3.js. The solution is to only rewrite if there are exactly 10 digits at the end. (Because 10 digits covers all timestamps from 9/9/2001 to 11/20/2286.) First, we use the … Read more