I am developing an e-commerce website in Python Django, which has a media folder that is taking a lot of time to load when opening pages. I have hosted this project on DigitalOcean using a droplet. I need a solution so that my media folder does not take time to load. Can I keep the media folder on another server to reduce loading time? If so, how can I do this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
One option here is to use an S3 storage, like the DigitalOcean Spaces together with CDN enabled:
https://docs.digitalocean.com/products/spaces/how-to/enable-cdn/
You can follow the steps on how to integrate Django with the DigitalOcean Spaces here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-object-storage-with-django
Alternatively, if you don’t want ot use an S3 storage, you could try just using a standard CDN like Cloudflare instead:
Let me know how it goes!
- Bobby
Heya @zappcodeacademy,
I’ll recommend using a CDN first and then an object storage like DigitalOcean Spaces.
Spaces : Simple and scalable S3-compatible object storage with a built-in content delivery network (CDN) to store, serve, back up, and archive any amount of web content, images, media, and static files for your web apps.
You can read more about it here:
https://www.digitalocean.com/products/spaces
and here:
https://www.digitalocean.com/pricing/spaces-object-storage
Good thing is that it’s a DigitalOcean product which works really good with other products like your Droplet.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.