I have created a Django app. it uses a bit more images and one page includes videos as well. the storage is on S3 AWS bucket on us-east-1. Database is in ap-south-1, AWS RDS PostgreSQL. the app itself is hosted on Heroku. I had also upgraded Heroku plan to professional so to get the best performance. when access the landing page, its fast enough. but after the login and each pages on dashboard, it takes so much time to refresh or load. it takes almost 4 to 10 sec. I also tried hosting on AWS, EC2. but same story.
Asked
Active
Viewed 329 times
3 Answers
2
Refer to this article - https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04.
Load images and videos from CDN.

shubham yadav
- 36
- 2
-
thanks for your comment. it had some good inside. – zaman Mar 10 '22 at 08:21
2
For an immediate solution, you should compress the images/videos as much as possible without noticeable quality reductions, so you are not having to load large files. If this is not possible then @shubham yadav's solution would be better with a CDN.

Dean Elliott
- 1,245
- 1
- 8
- 12
-
I'm not sure then, sorry. Might be worth contacting Heroku or something if this works fine locally. – Dean Elliott Jun 09 '21 at 15:09
2
updates: for the videos and images, I implemented Ajax calls to fetch them after page load. It works as fine now. the pages load fast enough and large contents load few seconds later as it fetched data from CDN.

zaman
- 123
- 1
- 11