I solved this issue using Flask Lazy loading views. Rather than importing everything in your main application .py file, just use lazy loading. This got my Flask app cold boot loading from 37 seconds down to 6-8 seconds. This doc helped me solve it: https://flask.palletsprojects.com/en/stable/patterns/lazyloading/