Well hello there!...have a look around my web portfolio...


CDN for Images with Django

(Comments)

One of the many performance boosts in an application I have been developing lead me to move all ~180,000 large high-quality images to a Rackspace CDN container. This turned out to be a bit more complicated than I had initially as we could not have any downtime and images are added at all times of day throughout the week.

The first piece of software I setup for this was django-cumulus. This allowed me to connect to the CDN server and specify it as the file storage either for everything or explicitly for just the model field which stores these images.

Unfortunately sometimes we upload lots of pictures at once and was getting unexpected results from the CDN when doing bulk uploads. The next piece of the puzzle I used was then django-queued-storage. This allowed me to first upload the images locally and then have a celery task move them to the Rackspace CDN server. This also took care of Django determining where to reference the image whether it was still on the local server or had been moved to the CDN server.

The last piece of configuration for us was getting easy-thumbnails to write the thumbnail images to the CDN, which worked flawlessly. All in all, this has proved to be a successful integration that caused zero downtime.

Comments