Commit 13f41449 authored by Pietro Albini's avatar Pietro Albini

Enable caching for most of the download pages

parent 83e39e9f
Pipeline #65 passed with stage
in 0 seconds
......@@ -68,7 +68,7 @@ def after_request(response):
# Do dome filtering
if status != 200 or method != "GET":
return result
return response
if url.endswith("/"):
url += "index.html"
......
......@@ -26,6 +26,7 @@ import itsdangerous
import requests
import pkg_resources
from . import cache
from . import launchpad
......@@ -218,6 +219,7 @@ class Downloads:
bp = flask.Blueprint("download", __name__)
@bp.route("/")
@cache.enable
def index():
return flask.render_template(
"download/index.html",
......@@ -225,6 +227,7 @@ class Downloads:
)
@bp.route("/<distro>")
@cache.enable
def landing(distro):
if distro not in self.config["distros"]:
flask.abort(404)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment