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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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.
Hi there,
One option here is to use an S3 storage, like the DigitalOcean Spaces together with CDN enabled:
You can follow the steps on how to integrate Django with the DigitalOcean Spaces here:
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