aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-07-02 21:31:33 +0200
committerDaniel Schadt <kingdread@gmx.de>2022-07-02 21:31:33 +0200
commit1b0f60125e304790322443dcee94ca9eba6999e4 (patch)
treea2074d1921458ba3494b89e001c7bd333eba6517
parent426bec7f419842aac785b05de642193d99bb33f8 (diff)
downloadfietsboek-1b0f60125e304790322443dcee94ca9eba6999e4.tar.gz
fietsboek-1b0f60125e304790322443dcee94ca9eba6999e4.tar.bz2
fietsboek-1b0f60125e304790322443dcee94ca9eba6999e4.zip
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.
-rw-r--r--fietsboek/views/detail.py4
1 files 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.