Heroku Slug Compiler Optimizations
June 2, 2013
.slugignore to reduce your slug size
This may be old news to some, but I recently learned about a cool Heroku feature: the
What is it?
.slugignore is like a
.gitignore file for your app. It is used to reduce the size of your slug file on Heroku by ignoring files that are not essential for your app to operate.
Why is it cool?
The smaller the slug file for your app, the faster Heroku can transfer it across dynos, making scaling much easier. Heroku suggests keeping your slug file size under 50MB, files smaller than 15MB are preferred.
How do I use it?
Place it in your project's root folder. It works the same way as a
.gitignore file does. The only difference is that it doesn't support the negation operator (!). See Heroku's documentation on its slug compiler for more information. Here are some suggestions of things that you may want to put in your
- Mockups and old versions of image assets
- Any project documents, PDF's, etc.
- Test files
test docs *.pdf