Skip to content

Commit 2b19b43

Browse files
committed
校对
1 parent 29165fe commit 2b19b43

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Browser/browser-en.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| Storage size of data | 4K | 5M | 5M | unlimited |
99
| Communicate with server | it is carried in the header everytime, and has a performance impact on the request | doesn't participate | doesn't participate | doesn't participate |
1010

11-
11+
1212
As we can see from the above table, cookies are no longer recommended for storage. We can use localStorage and sessionStorage if we don't have much data to storage. Use localStorage to storage the data that doesn't change much, otherwise sessionStorage can be used.
1313

1414
##### Service Worker
@@ -23,10 +23,10 @@ if (navigator.serviceWorker) {
2323
navigator.serviceWorker
2424
.register("sw.js")
2525
.then(function(registration) {
26-
console.log("service worker 注册成功");
26+
console.log("service worker register success");
2727
})
2828
.catch(function(err) {
29-
console.log("servcie worker 注册失败");
29+
console.log("servcie worker register error");
3030
});
3131
}
3232
// sw.js
@@ -55,6 +55,12 @@ self.addEventListener("fetch", e => {
5555

5656
Start the page, we can see that the Service Worker has started in the `Application` of the devTools
5757

58+
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b1e8eba68e1c?w=1770&h=722&f=png&s=192277)
59+
5860
In the Cache, we can also find that the files we need have been cached
5961

60-
Refreshing the page, we can see that our cached data is read from the Service Worker
62+
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b20dfc4fcd26?w=1118&h=728&f=png&s=85610)
63+
64+
Refreshing the page, we can see that our cached data is read from the Service Worker
65+
66+
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b20e4f8f3257?w=2818&h=298&f=png&s=74833)

0 commit comments

Comments
 (0)