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 ^/list$ /list.json break;
|
||||
|
||||
location = /list.json { expires 20s; }
|
||||
|
||||
try_files $uri @uwsgi;
|
||||
location @uwsgi {
|
||||
include uwsgi_params;
|
||||
|
||||
@@ -73,9 +73,9 @@ def index():
|
||||
|
||||
@app.route("/list")
|
||||
def list_json():
|
||||
# We have to make sure that the list isn't cached,
|
||||
# since the list isn't really static.
|
||||
return send_from_directory(app.static_folder, "list.json", max_age=0)
|
||||
# We have to make sure that the list isn't cached for too long,
|
||||
# since it isn't really static.
|
||||
return send_from_directory(app.static_folder, "list.json", max_age=20)
|
||||
|
||||
|
||||
@app.route("/geoip")
|
||||
|
||||
Reference in New Issue
Block a user