mobile: cache-bust static assets so browser picks up CSS/JS edits
User reported phone still showing old behaviour (Qty/Avg portfolio
columns visible) even though the server-side JS had been updated.
Root cause: every <link>/<script> URL was a plain
/static/css/foo.css with no query string, so mobile Chrome served
the file from its HTTP cache rather than refetching it.
Adds a process-startup timestamp to the Jinja environment as
ASSET_VERSION (computed once when templates_env is imported). Every
<link>/<script> reference now appends `?v={{ ASSET_VERSION }}` so a
container restart bumps the URL and the browser refetches. 38 URLs
across 8 templates updated via sed; tests still pass.
Side benefit: future CSS/JS edits no longer require users to hard-
refresh.
This commit is contained in:
parent
1a20f0a15b
commit
daa3f79a52
9 changed files with 47 additions and 38 deletions
|
|
@ -102,9 +102,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="{{ url_for('static', path='/js/portfolio-sync.js') }}" defer></script>
|
||||
<script src="{{ url_for('static', path='/js/portfolio.js') }}" defer></script>
|
||||
<script src="{{ url_for('static', path='/js/portfolio_edit.js') }}" defer></script>
|
||||
<script src="{{ url_for('static', path='/js/portfolio-sync.js') }}?v={{ ASSET_VERSION }}" defer></script>
|
||||
<script src="{{ url_for('static', path='/js/portfolio.js') }}?v={{ ASSET_VERSION }}" defer></script>
|
||||
<script src="{{ url_for('static', path='/js/portfolio_edit.js') }}?v={{ ASSET_VERSION }}" defer></script>
|
||||
|
||||
<section id="log-panel" class="panel">
|
||||
<div class="panel-header">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue