Reputation: 1127
I'm using Angular 5 application and i'm loading quite big JSON file. The problem is that it takes a long time to load main .js
bundle, initialize it, bootstrap Angular app which later fetches that JSON file.
If i could preload that JSON file while Angular app gets ready, it would speed up initial page load.
I tried to use <link rel="preload" href="/path/to/json" as="script">
but that doesn't help and now JSON file is loaded twice. I tried other as
values but nothing works.
What should be correct way to preload JSON file?
Upvotes: 5
Views: 5147
Reputation: 111
You can use <link rel="preload" href="/path/to/json" as="fetch">
.
Upvotes: 11