Use Grunt or Gulp to minify your assets as a build step in production/testing. Have the task update a config variable in your config.php to set a version number. Output paths using the version number as a segment and set a very long cache expiration (20 years). Use an htaccess rule to remove the version number from the path and direct it to the actual file.