Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Open Source
offline
Commits
d4f0c8a5
Commit
d4f0c8a5
authored
Dec 05, 2018
by
Cerdic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
versionnage du js et affichage dans la console, meme en prod
parent
0565d9ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
javascript/offline.sw.js
javascript/offline.sw.js
+4
-1
javascript/offline.sw.manager.js
javascript/offline.sw.manager.js
+2
-0
javascript/offline.sw.utils.js
javascript/offline.sw.utils.js
+2
-1
No files found.
javascript/offline.sw.js
View file @
d4f0c8a5
...
...
@@ -40,7 +40,10 @@ self.addEventListener('fetch', function (event){
switch
(
strategy
)
{
case
offline
.
_NETWORK_ONLY
:
event
.
respondWith
(
offline
.
networkOnly
(
event
));
if
(
offlineConfig
.
debug
)
{
// for debug use offline.networkOnly
event
.
respondWith
(
offline
.
networkOnly
(
event
));
}
// or simply don't call event.respondWith, which
// will result in default browser behaviour
break
;
...
...
javascript/offline.sw.manager.js
View file @
d4f0c8a5
...
...
@@ -3,6 +3,8 @@ offline.manager = function (request){
var
strategy
;
if
(
request
.
mode
===
'
navigate
'
){
console
.
log
(
'
Offline SW version
'
+
offline
[
'
sw.js
'
]);
console
.
log
({
cacheName
:
offlineConfig
.
cacheName
,
strategyNav
:
offlineConfig
.
strategyNav
,
strategyRes
:
offlineConfig
.
strategyRes
,
mediaMaxCacheSize
:
offlineConfig
.
mediaMaxCacheSize
});
// default strategy
strategy
=
offlineConfig
.
strategyNav
;
...
...
javascript/offline.sw.utils.js
View file @
d4f0c8a5
var
offline
=
{
version
:
23
,
version
:
0
,
// utilisable en debug pour incrementer et verifier la mise a jour du service
'
sw.js
'
:
0
,
// surcharge en prod lors de l'ecriture du fichier statique pour afficher un numero de version coherent avec celui du fichier
/* Flag pour forcer la mise a jour sur un ?var_mode, jusqu'a la requete principale suivante */
forceRefresh
:
false
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment