laravel/laravel — pull request #2939 by reinink (2014-05-28 16:46:24+00:00)
Title: Enable filename-based cache busting on dev server

Filename-based cache busting is a popular approach to versioning public assets. Put simply, it allows the injection of a version number into an asset's filename without actually having to renaming the file itself. This allows for far-future expires headers on public assets with an easy way to break this cache. This is done using URL rewriting, currently only possible when using Apache or Nginx, not the built-in PHP server.

The following addition to `server.php` adds this functionality to the local development server. This shouldn't have any backwards breaking side effects, since it first checks to see if the file already exists.

I debated using [fileinfo](http://www.php.net/manual/en/function.finfo-file.php) to determine the mime type, but this seemed like overkill considering how few asset types this is required for. Further, I've noticed issues with fileinfo in certain environments where the definition (magic) file is out of date.

As noted in the comments, this approach was made popular by the HTML5 Boilerplate project. See their [.htaccess](https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L624) file for more information.

I believe this should be part of the default Laravel install because:

1. Filename-based cache busting is used by many Laravel developers
2. Without it developers have to "duck tape" a solution together for their dev environment
3. Without it developers may be less likely to use this very smart approach to cache busting
4. Not having this creates a barrier to using the built-in PHP server for those familiar with using `.htaccess` files
5. I don't see any backwards compatibility issues
6. The work is done :)

Thanks!