How to cache signed files (Service worker)

0

Several front-end applications implement a signature template in the files to control the cache, and every change in the file that signature changes.

Signature examples:

sw-d58e3582afa99040e27b92b13c8f2280.js sw.js? _gc = 20180101

How do you make Service Worker handle these signatures and cache it?

+ information I'm working on an application that is already ready, trying to implement service worker for certain features to be available offline.

Example, in this section I need to say what I will cache, however, the application changes the signatures of the file to control the cache. (today is like this)

caches.open('my-cache').then(function(cache) {
return cache.addAll([
    '/index.html',
    '/styles.css',
    '/main.js'
]);})

The application is always changing "styles.css" to "styles.css? v = 1527624807103_1" (timestamp) As far as I understand, "styles.css" is not the same as "styles.css? V = 1527624807103_1".

    
asked by anonymous 30.05.2018 / 20:35

0 answers