I'm not sure if this belongs here on Server Fault or if it belongs over on Software Engineering, but as this most likely deals heavily with the server side of hosting my website and related files, I believe here may be the better fit. If I'm wrong, please let me know so that we can get the question migrated to the proper location.

Also, I wasn't sure what tags were the best fit either as I'm primarily a software developer and this is my first experience where I haven't had a server team to handle these types of ideas or at least assist with them.

I recently inherited a website that is loaded down with about 1.8GB worth of image files. Most of these are most likely not used anymore, but I don't currently have time to sort through them and determine for sure which ones can stay and which can go.

To top this off, more recently, I've received a request to add about 105MB worth of image files to this already large project. I wouldn't mind at all if we didn't currently store all of these images in source control.

This makes deployments, mapping, branching, and merging very time consuming and tedious and thus I would like a way to separate the content based files from the code files essentially stripping the project to it's bare bones (in the future) and pulling the files from an alternate location that is only updated when needed and eliminating the extra large footprint in source control (and on my hard drive since I currently have 8 different branches of the same complete project on my local machine for development, testing, prototyping, etc.).

Again, I haven't had a whole lot of time to tackle this issue, but with the new request I'd like to prevent myself from contributing to the issue and instead focus my efforts on a long term solution that I can add all of my new content to and slowly transition everything else in when time permits.

The only theory I've come up with so far is creating a sub domain on my web server that is dedicated to holding content files that I can pull via web address from my primary domain. I'm not sure this is a good approach but the way I'm thinking about it might be.

  1. What would be a solid option that meets best practices to separate this out?
  2. What are some potential gotchas with this type of separation?


  • Currently locked into TFS for source control.
  • Would like to remove the images from source control.


Placing all your image content on a sub-domain would help. Browsers have limited concurrent capability of content from a single one domain. A sub-domain is considered a separate domain from the browser's perspective. So download times should be reduced.


Another possibility is to store the images on a image hosting service. This can save you image administration, reduces site network bandwidth and load times. Some services have worldwide coverage (CDNs) so that media content can be downloaded from the closest node, reducing page load times.


Note your hosting may or may not permit subdomains to exist outside the document root of your site.

Source Control

Having worked on large source repositories and the problems that they present, removing all that static content from the repo will help enormously. It's a burden which puts your source control security at risk. When we migrated a huge repo from our server to a very well-known hosted repository service, we had to lose years of history because of the large size of one of our repositories.

|improve this answer|||||
  • Thanks for the insight! When it comes to external hosting, do you have a few examples of sites with worldwide coverage? – Emma - PerpetualJ Aug 7 '19 at 13:41
  • imgur, pcloud, flikr and there are many many more – suspectus Aug 7 '19 at 14:06
  • Would drop box happen to be one? We currently use drop box in house for file sharing so it wouldn't be a change on anyone else's part, just mine. – Emma - PerpetualJ Aug 7 '19 at 14:37
  • indeed, yes dropbox also – suspectus Aug 7 '19 at 14:49
  1. What would be a solid option that meets best practices to separate this out?

git LFS is the solution for handling large files in git

  1. What are some potential gotchas with this type of separation?
|improve this answer|||||

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.