Generally assets are stored in your public directory, right? They are public, so anyone can get access to them. But nowadays the performance is a very important factor when deploying a new app. I strongly recommend you to minify and cache your assets, like CSS files, Javascript files and Images.
If you are using 11 javascript files in your app you don’t have to make 11 requests on the server, one per JS files. You can easily join all files and minify them, so you will have just one minified file. This is easy to do using Laravel 4! I’ve found four Laravel 4 assets managers:
- codesleeve/asset-pipeline: My choice! It is easy to understand and to work with
- jasonlewis/basset: Very good library created by Jason Lewis
- teepluss/asset: Based on the Laravel 3 Asset class. It does not minify or join your files.
- way/guard-laravel: A very good package but you must have Ruby installed
We will work with codesleeve/asset-pipeline package. It’s easy to use and simple to understand.