DigitalCommons / open-data-and-maps

Deprecated: Implementation of Linked Open Data by the Solidarity Economy Association
6 stars 1 forks source link

Add mechanism to force download of updated JavaScript/CSS #163

Closed joebillings closed 5 years ago

joebillings commented 5 years ago

We should add a version or token to paths to resources that is increased/changed when they are updated. This will force the browser to always downloaded the latest version rather than their browser's cached version.

This will look something like this:

Output

<link rel="stylesheet" href="css/main.css?v=1.0.5" />
<script src="map-app/map-app.js?v=1.1.12"></script>

The code might look something like this (so we only have to change a config file rather than hunting down the token in the code):

<link rel="stylesheet" href="css/main.css?v=**CSS_VERSION**" />
<script src="map-app/map-app.js?v=**JS_VERSION**"></script>
joebillings commented 5 years ago

I haven't been able to reliably add a method to do this automatically. Currently the locations of the versions to update when they've changed are:

www/index.html (<link rel="stylesheet" href="map-app/map-app.css?v=1.0.0" />) www/map-app/map-app.js (dataMain.value = "map-app/app.js?v=1.0.0";)