Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit 5ab4591

Browse files
committed
docs(readme): update load time
style: update example style: update example style: update example
1 parent a6f7be3 commit 5ab4591

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
1010
>use **back-loader** in your project, you can quickly preload more pictures, styles(.css) or scripts, it will make your website more fluent.
1111
12+
According to my data,use `back-loader` preload all page in production project, DomReadyTime < 200 ms !!!
13+
the user experience of each page can be greatly improved.
1214
<br>
1315

1416
#### Usage
@@ -39,15 +41,14 @@ type loadEvent = {
3941
insertScripts?: Function,
4042
}
4143
```
42-
<br>
43-
44-
#### More
4544
46-
1. the resources of different domain names can be loaded normally.
47-
2. if you use `page`, `back-loader` automatically analyzes every resources included in the page. but domain name needs to be the same as the current page. (of course)
45+
For example, i want preload `google.com/new-product.html` page, then append the above code on the home page (or any other pages),
46+
like `setTimeout(() => backHandler.start(), 1000)`, browser will load all resources and caching to memory or disk,
47+
waiting for the user to browse `google.com/new-product.html`,just need few millisecond!
4848
4949
<br>
5050
51+
5152
#### LICENSE
5253
5354
**MIT**

examples/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ document.title = 'hello'
44
const handler = async() => {
55
const backLoader = new BackLoader({
66
// scripts: ['https://code.jquery.com/jquery-3.2.1.slim.min.js'],
7-
pages: ['https://napos-care-plan.faas.ele.me/#/h5/board'],
7+
pages: ['https://www.baidu.com'],
88
// images: ['https://www.bing.com/az/hprichbg/rb/TadamiTrain_ROW14602114613_1920x1080.jpg'],
99
})
1010
backLoader.start().on(event => {

0 commit comments

Comments
 (0)