Z
Z
zyusifov112021-01-14 22:33:39
Nginx
zyusifov11, 2021-01-14 22:33:39

How to update files in flask app nginx?

I'm a beginner, don't judge strictly, there is a site on flaske on ubuntu nginx, I change it, let's say the html file restarts the server and the browser is old, although on the server it shows everything that I changed
how to solve this problem I'm very happy to help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2021-01-14
@ky0

Set up caching, or rather, its absence for certain urls. Or - add a parameter to the urls that changes after the update: https://example.com/somepage.html?2021011401

G
ge, 2021-01-15
@gedev

I restart the server

Is this a restart of nginx , gunicorn or are you restarting the entire server?
If you are editing .html files that Flask processes (templates) and the old template is preserved (cached), restarting gunicorn will be enough. To be sure, first kill all active gunicorn processes with kill / htop , whichever is more convenient, and start again.
If the problem is editing html files that nginx serves directly (without proxying the file request to your application), then see the file caching settings in nginx , exclude the html cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question