DEV Community

Discussion on: Qwik – The Post-Modern Framework

Collapse
 
ayoub_alouane profile image
Ayoub Alouane Playful Programming • Edited

Thank you for your comment, it's an old Article that i wrote, i just republished it here, so to answer your question, Qwik will not download every file only when you click, but after doing the first load to show the page, the framework will start automatically downloading the code necessary fo the web app using a service worker, and it will store it in the cache, so we will not sent a request to the server and wait 2 secondes every time someone click on a button but it will grab it instantly from the cache of the browser, if the code is not downloaded yet it will download it from the server, to have details here is the explanation of how this prefetching works: qwik.builder.io/docs/advanced/spec...
(just updated the article with that part)

Collapse
 
hoachlinux profile image
Nguyen Hoach

Nice

Collapse
 
mindplay profile image
Rasmus Schultz

Yes, effectively a re-implementation of browser native prefetch - this optimization is available to an MPA as well. 🙂

Thread Thread
 
mhevery profile image
Miško Hevery

We tried prefetching, but it did not quite work, and so we had to build the Service Worker builder.io/blog/code-prefetching-i...