Skip to content

Commit 00ea15c

Browse files
committed
Add preload tags for data, wasm and framework.js files
This way they are started to being loaded right away, and already have made some progress when the loader requests them
1 parent b1f7273 commit 00ea15c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Assets/WebGLTemplates/Develop/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="debug-console.css">
8+
<!-- Start loading assets right away, to have them (partly) loaded already when they are requested -->
9+
<link rel="preload" href="Build//{{{ DATA_FILENAME }}}" as="fetch" type="application/octet-stream" crossorigin>
10+
<link rel="preload" href="Build/{{{ FRAMEWORK_FILENAME }}}" as="script">
11+
<link rel="preload" href="Build/{{{ CODE_FILENAME }}}" as="fetch" type="application/wasm" crossorigin>
712
<title>{{{ PRODUCT_NAME }}}</title>
813
<style>
914
* {
@@ -113,7 +118,6 @@
113118
transition: 400ms linear;
114119
}
115120
</style>
116-
<link rel="stylesheet" href="debug-console.css">
117121
</head>
118122

119123
<body>

Assets/WebGLTemplates/Release/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<!-- Start loading assets right away, to have them (partly) loaded already when they are requested -->
8+
<link rel="preload" href="Build//{{{ DATA_FILENAME }}}" as="fetch" type="application/octet-stream" crossorigin>
9+
<link rel="preload" href="Build/{{{ FRAMEWORK_FILENAME }}}" as="script">
10+
<link rel="preload" href="Build/{{{ CODE_FILENAME }}}" as="fetch" type="application/wasm" crossorigin>
711
<title>{{{ PRODUCT_NAME }}}</title>
812
<style>
913
* {

0 commit comments

Comments
 (0)