Book Image

Heroku Cloud Application Development

By : Anubhav Hanjura
Book Image

Heroku Cloud Application Development

By: Anubhav Hanjura

Overview of this book

Table of Contents (17 chapters)
Heroku Cloud Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Optimizing slug size


You may not want to push everything in your application to Heroku for a wide variety of reasons. For example, you don't really need to send logfiles or static assets to your remote Heroku environment because it is pretty much useless to store them on the remote as they would occupy disk space for no valid reason.

For this cause, Git provides you with a way to skip files or directories you don't want or those that you need to push to the remote environment. This ability is available through the .gitignore file, which contains the list of files that you don't want to push across. This list can be literal filenames or wildcard filenames. Git ignores these files when pushing the code to the remote Heroku environment. This has the added benefit of keeping the slug size smaller and speeding up the boot up time for the dynos.

While pushing your code to Heroku, ensure that unnecessary files aren't pushed across, for example, a log or a temporary working directory. As a user, you...