Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
87af1fc6
Commit
87af1fc6
authored
May 18, 2021
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Markdown style
parent
ed7ce475
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
doc/development/fe_guide/performance.md
doc/development/fe_guide/performance.md
+6
-6
No files found.
doc/development/fe_guide/performance.md
View file @
87af1fc6
...
...
@@ -248,8 +248,8 @@ properties once, and handle the actual animation with transforms.
### Prefetching assets
In addition to prefetching data from the
[
API
](
./
graphql.md#making-initial-queries-early-with-graphql-startup-calls
)
we allow prefetching the named Java
s
cript "chunks" as
In addition to prefetching data from the
[
API
](
graphql.md#making-initial-queries-early-with-graphql-startup-calls
)
we allow prefetching the named Java
S
cript "chunks" as
[
defined in the Webpack configuration
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/webpack.config.js#L298-359
)
.
We support two types of prefetching for the chunks:
...
...
@@ -261,12 +261,12 @@ We support two types of prefetching for the chunks:
Both
`prefetch`
and
`preload`
links bring the loading performance benefit to the pages. Both are
fetched asynchronously, but contrary to
[
deferring the loading
](
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-defer
)
of the assets which is used for other
javas
cript resources in the product by default,
`prefetch`
and
`preload`
neither parse nor execute the fetched script unless explicitly imported in any
javas
cript
of the assets which is used for other
JavaS
cript resources in the product by default,
`prefetch`
and
`preload`
neither parse nor execute the fetched script unless explicitly imported in any
JavaS
cript
module. This allows to cache the fetched resources without blocking the execution of the
remaining page resources.
To prefetch a Java
s
cript chunk in a HAML view,
`:prefetch_asset_tags`
with the combination of
To prefetch a Java
S
cript chunk in a HAML view,
`:prefetch_asset_tags`
with the combination of
the
`webpack_preload_asset_tag`
helper is provided:
```
javascript
...
...
@@ -281,7 +281,7 @@ This snippet will add a new `<link rel="preload">` element into the resulting HT
```
By default,
`webpack_preload_asset_tag`
will
`preload`
the chunk. You don't need to worry about
`as`
and
`type`
attributes for preloading the Java
s
cript chunks. However, when a chunk is not
`as`
and
`type`
attributes for preloading the Java
S
cript chunks. However, when a chunk is not
critical, for the current navigation, one has to explicitly request
`prefetch`
:
```
javascript
...
...
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