As you build out your application, scalability will start become an issue. You will find yourself making queries to the database every page load cost you precious cpu and load time. The trick is to cache frequently used data so that a database query is not necessary, reducing the overhead on your server.
When using a Multi-Environment setup for your development process it is essential to have adequate protection from outside prying eyes, but also allow people to access your public/testing sites. This .htaccess code allows you to do that.