Skip to content

Commit b65617d

Browse files
committed
avoid cache static resource after version upgrade
1 parent 8b62985 commit b65617d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pywebio/platform/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def render_page(app, protocol, cdn):
4949
check_theme(theme)
5050

5151
return _index_page_tpl.generate(title=meta.title, description=meta.description, protocol=protocol,
52-
script=True, content='', base_url=base_url,
52+
script=True, content='', base_url=base_url, version=version,
5353
js_file=meta.js_file or [], js_code=meta.js_code, css_style=meta.css_style,
5454
css_file=meta.css_file or [], theme=theme)
5555

pywebio/platform/tpl/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link rel="stylesheet" href="{{ base_url }}css/toastify.min.css">
1313
<link rel="stylesheet" href="{{ base_url }}css/bs-theme/{{ theme }}.min.css">
1414
<link rel="stylesheet" href="{{ base_url }}css/bootstrap-select.min.css">
15-
<link rel="stylesheet" href="{{ base_url }}css/app.css">
15+
<link rel="stylesheet" href="{{ base_url }}css/app.css?v={{ version }}">
1616
{% for css in css_file %}
1717
{% if css %}<link rel="stylesheet" href="{{ css }}">{% end %}
1818
{% end %}
@@ -57,7 +57,7 @@
5757
if (window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1)
5858
$('#output-container').html('<div class="alert alert-danger" role="alert"> Sorry, this website does not support IE browser. ☹ </div>');
5959
</script>
60-
<script src="{{ base_url }}js/pywebio.min.js"></script>
60+
<script src="{{ base_url }}js/pywebio.min.js?v={{ version }}"></script>
6161
{% for js in js_file %}
6262
{% if js %}<script src="{{ js }}"></script>{% end %}
6363
{% end %}

0 commit comments

Comments
 (0)