add a timestamp to graph.svg to avoid caching

This commit is contained in:
Wojciech Kwolek 2020-09-14 00:37:51 +02:00
parent 15e33bef75
commit e5163946b8
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ from wtforms import StringField, SubmitField, IntegerField
from wtforms.validators import DataRequired, Length, NumberRange
from .db import db, Accomplishment
from datetime import datetime, timedelta
import time
main = Blueprint('main', __name__)
@ -72,6 +73,7 @@ def get_day_template_data(day_string):
},
"accomplishments": accomplishments,
"total_xp": sum(a.difficulty for a in accomplishments),
"ts": int(time.time()), # timestamp for cachebusting
}

View File

@ -13,7 +13,7 @@
</form>
</div>
<div class="max-w-lg mx-auto card">
<img class="w-full h-48" src="{{ url_for('graph.graph_svg') }}">
<img class="w-full h-48" src="{{ url_for('graph.graph_svg', ts=ts) }}">
</div>
<div class="max-w-lg mx-auto card">
<div class="flex items-center justify-between mb-4">