mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-25 19:36:15 +02:00
increment cache version for service-worker.js (#1644)
* increment cache version * add serviceworker incrementer on make bundle
This commit is contained in:
3
Makefile
3
Makefile
@@ -86,3 +86,6 @@ bundle:
|
|||||||
npm run vendor_minify_css
|
npm run vendor_minify_css
|
||||||
npm run vendor_bundle_js
|
npm run vendor_bundle_js
|
||||||
npm run vendor_minify_js
|
npm run vendor_minify_js
|
||||||
|
# increment serviceworker version
|
||||||
|
sed -i -e "s/CACHE_VERSION =.*/CACHE_VERSION = $$(awk '/CACHE_VERSION =/ { print 1+$$4 }' lnbits/core/static/js/service-worker.js)/" \
|
||||||
|
lnbits/core/static/js/service-worker.js
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
// the cache version gets updated every time there is a new deployment
|
// update cache version every time there is a new deployment
|
||||||
const CACHE_VERSION = 1
|
// so the service worker reinitializes the cache
|
||||||
|
const CACHE_VERSION = 2
|
||||||
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
|
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
|
||||||
|
|
||||||
const getApiKey = request => {
|
const getApiKey = request => {
|
||||||
|
Reference in New Issue
Block a user