Set short max_age for list.json
This commit is contained in:
@@ -102,6 +102,8 @@ root /path/to/server/static;
|
|||||||
rewrite ^/$ /index.html break;
|
rewrite ^/$ /index.html break;
|
||||||
rewrite ^/list$ /list.json break;
|
rewrite ^/list$ /list.json break;
|
||||||
|
|
||||||
|
location = /list.json { expires 20s; }
|
||||||
|
|
||||||
try_files $uri @uwsgi;
|
try_files $uri @uwsgi;
|
||||||
location @uwsgi {
|
location @uwsgi {
|
||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ def index():
|
|||||||
|
|
||||||
@app.route("/list")
|
@app.route("/list")
|
||||||
def list_json():
|
def list_json():
|
||||||
# We have to make sure that the list isn't cached,
|
# We have to make sure that the list isn't cached for too long,
|
||||||
# since the list isn't really static.
|
# since it isn't really static.
|
||||||
return send_from_directory(app.static_folder, "list.json", max_age=0)
|
return send_from_directory(app.static_folder, "list.json", max_age=20)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/geoip")
|
@app.route("/geoip")
|
||||||
|
|||||||
Reference in New Issue
Block a user