Forums

Slow image loading

Hello!

I made a simple flask app. Python-part works fine. But I ran into a problem with very slow .jpg or .png files loading. Here's an example: http://proverkaznaniy.pythonanywhere.com/?id=7. The file 'task8_0.jpg' loaded for 2.57s. I upgraded my account but it didn't help. How can I boost loading process?
I have no problems with speed on other sites

hmm- it seems to be loading fine from where I am. Perhaps that is because your site is under less traffic at the moment?

There are two major improvements you can do:

  1. make sure you setup static file mappings under your PythonAnywhere webapp settings
  2. put a CDN in front of PythonAnywhere to cache static images

Noob question: What is a CDN?

A "content deliver network" it's a product that takes your static assets and spreads them around the world so that when someone requests one of them, they get it from the server closest to them.