-
Notifications
You must be signed in to change notification settings - Fork 0
/
integrity-and-prefetch.html
74 lines (73 loc) · 2.87 KB
/
integrity-and-prefetch.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Demo Page for Subresource Integrity and Prefetch</title>
<meta name=description content="demo page for Subresource Integrity (SRI) and Prefetch">
<meta http-equiv=X-UA-Compatible content="IE=Edge">
<meta name=viewport content="width=device-width,initial-scale=1.0">
<meta name=robots content=index,follow>
<link rel=canonical href=https://laysent.github.io/subresource-integrity-demo/integrity-and-prefetch.html />
<link rel=prefetch href=./style.css as=style crossorigin=anonymous />
<link rel=prefetch href=./script.js as=script crossorigin=anonymous />
<link
href=./main.css
rel=stylesheet
integrity="sha512-mbzzgGIjfEC93ZP2SML7m8+qpNxg4KQH5s28RcwDGfgB8mpa9MbIlSg1GDd6IMeHowT1owpRqNnSJK7Feob12g=="
crossorigin=anonymous
/>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-31656866-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-31656866-1');
</script>
</head>
<body>
<main>
<h1>Subresource Integrity and Prefetch</h1>
<section>
<h2>explaination</h2>
<p>
This demo page is to help you understand behavior of <em>Prefetch</em> and <em>SRI</em>
resources.
</p>
<p>
<em>Prefetch</em> is widely supported in browsers and is intended for prefetching resources
that will be used in the next navigation/page load. Stylesheet and script have been prefetched
on this page. You could navigate to following pages and see how it behaves:
</p>
<ul>
<li>
<a href=./integrity-and-prefetch-next.html?integrity=all>Page 1</a>
- Stylesheet and script are loaded with <em>SRI</em> enabled.
</li>
<li>
<a href=./integrity-and-prefetch-next.html?integrity=style>Page 2</a>
- Stylesheet is loaded with <em>SRI</em> enabled, but script is not.
</li>
<li>
<a href=./integrity-and-prefetch-next.html?integrity=script>Page 3</a>
- Script is loaded with <em>SRI</em> enabled, but stylesheet is not.
</li>
<li>
<a href=./integrity-and-prefetch-next.html>Page 4</a>
- Stylesheet and script are loaded without <em>SRI</em> enabled.
</li>
</ul>
<p>
Unless cache is disabled, <em>Prefetch</em> should ensure that resources can be directly
used from cache on next page with or without <em>SRI</em> enabled.
</p>
</section>
<section>
<a href=./index.html>Back</a>
</section>
<footer>
© 2018 LaySent.
</footer>
</main>
</body>
</html>