Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce Heroku Compiled Slug Size

Tags:

ruby

heroku

slug

I've just updated rails to v2.3.6 on my app under a bamboo-ree-1.8.7 stack and the compiled slug size has grown up to 40.5Mb! Previous to that last git push, the slug size was about 20Mb and was using rails v2.3.5.

Is it because my slug has both of rails versions installed? Probably I'm missing something but I haven't added any special code/files into my app as to increase the slug size by ~20Mb.

Can you point me on how can I reduce the slug size?

Any help will be greatly appreciated.

Thank you very much in advance.

like image 274
Estanislau Trepat Avatar asked May 26 '10 09:05

Estanislau Trepat


2 Answers

One thing that helps is adding a .slugignore file to the root of your project to tell Heroku not to compile certain files or directories into the slug. Mine looks like this:

*.psd
*.pdf
test
spec
features
doc
public

The public entry is in there because I serve all static files from Amazon's S3 service; just leave that line off if you're not using an external content-delivery system.

like image 181
James A. Rosen Avatar answered Oct 04 '22 03:10

James A. Rosen


If you're using less/bootstrap, on the cedar stack, then you can reduce slug size by precompiling and scripting up your precompile and push so that the less gem and dependencies are not included see here.

like image 43
Damon Mannion Avatar answered Oct 04 '22 04:10

Damon Mannion