From 1b0f60125e304790322443dcee94ca9eba6999e4 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 2 Jul 2022 21:31:33 +0200 Subject: add caching to GPX and badge files They shouldn't change that much (currently, there is not even a way to change them from the web), and it saves a lot of data to cache the megabytes of GPX data. --- fietsboek/views/detail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fietsboek/views/detail.py b/fietsboek/views/detail.py index ba7e946..7d0337a 100644 --- a/fietsboek/views/detail.py +++ b/fietsboek/views/detail.py @@ -36,7 +36,7 @@ def details(request): 'description': description, } -@view_config(route_name='gpx') +@view_config(route_name='gpx', http_cache=3600) def gpx(request): """Returns the actual GPX data from the stored track. @@ -72,7 +72,7 @@ def invalidate_share(request): return HTTPFound(request.route_url('details', id=track.id)) -@view_config(route_name='badge') +@view_config(route_name='badge', http_cache=3600) def badge(request): """Returns the image data associated with a badge. -- cgit v1.2.3