Earlier, when images were to be added to staging/production, they were committed to the git repository and our deploy script used to take care of uploading the images to CDN (S3 in our case).

But as we improved our design, the number and size of images began increasing. It was then decided that we will not be uploading retina images to the repo and they will be uploaded directly to S3.

This is a good enough workflow on paper, but it has its own fair share of issues. Especially when certain fixes/changes need to be deployed urgently and the images are forgotten.

How do web services handle image uploads for their websites?

The reason we are not uploading to the repo is because it causes it to bloat a lot. Is that an issue we should overlook for ease of workflow?


Well, binary files aren't supposed to be part of your repository indeed. As an alternative scenario, you should probably be looking at deploying code from repo to hosting platform and static files (images/documents/...) to another destination, a CDN for example.

Another alternative for web might be ton include some of the images as base64 encoded strings in your CSS, but this calls for a very heavy CSS and shouldn't be done for "content" images, rather "UI" ones like icons or so...

| improve this answer | |
  • We do host static files from the repo to CDN but that still needs to be committed to the repo doesn't it? I am trying to think if that is necessary at all. – Sinstein Feb 10 '16 at 13:00
  • Well basically for static/binary files you don't need that much of source control, but well the version control part. I wouldn't put that kind of files into the repo but investigate for another solution providing versioning; However, I must say there is no "1-size-fits-all" solution, as you mentioned: having it in the repo wasn't too much of a trouble until recently... – Laurent S. Feb 10 '16 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.