diff --git a/view/app.py b/view/app.py index 28cd3dd..8ce5868 100644 --- a/view/app.py +++ b/view/app.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 import sqlite3 -from flask import Flask, request, render_template, g, send_from_directory +from flask import Flask, make_response, request, render_template, g, send_from_directory from flask_paginate import Pagination, get_page_parameter import confuse import re @@ -83,7 +83,7 @@ def index(): ) diffs = db.fetchall() - return render_template( + html = render_template( "./index.html", diffs=diffs, page=page, @@ -93,6 +93,11 @@ def index(): expand_diffs=expand_diffs, ) + res = make_response(html) + res.cache_control.max_age = 60 + res.cache_control.public = True + return res + @app.route("/article/") def article_detail(article_id: str):