prefetchPageResources does not impact website

Hello Wix team

I was very enthusiastic about the new prefetchPageResources API .

Unfortunately, it does not have an impact on the loading time of my lightBox. See this website for instance. On mobile scroll to the map, click on a location on the map. Lightbox takes more than 2 seconds to open and nothing changed with prefetch.

  1. How are we supposed to use that method? within page code, within site code?

  2. Can it work on the landing page?

  3. Does it work on mobile?

  4. What should be the expected effect (in time decrease) of using prefetch?

  5. What are the drawbacks of using prefetch ? I mean, why not prefetch all the pages and all the lightboxes ?

thx for your answers @yisrael-wix


I also tried prefetch for Lightbox and there really wasn’t a noticeable difference at all.



Yup …me too. I recorded a video to check site difference before and after code … no clue if it even worked (because there was visible difference and) because the console log message didnt even work …so …

Help, Wix?


Yes. I couldn’t feel a significant change either.

but the console.log worked for me (after I moved the prefetch to inside an $w.onReady() function, which as I said was missing from the documentation).


Lightboxes by default should load instantly. I don’t understand what is going on here, many people have been airing these concerns since lightboxes were released. Would love some comments from Wix about this :slight_smile:

1 Like

Could we have some kind of answer from Wix team ? :slight_smile:

1 Like

Let’s ask @oferr , He wrote about this feature in the other forum.

Hi @plomteuxquentin ,

  1. Both will work, use it within the page that has the link to the lightbox, so when the visitor clicks on that link, the lightbox will load a bit faster.
  2. No, because it prepares the NEXT lightbox/page, landing page is the first one to load.
  3. Yes
  4. It depends on the page/lightbox you are going to prefetch, and on our internal optimisations. At the moment on fast networks it is around 100ms faster, and on slow networks it’s 3s-10s faster.
  5. Prefetch happens when the browser is idle, so doing it to all pages means the first ones will probably be prefetched and the last ones won’t. Other than that there is no restriction.

We are working on making lightboxes load faster, but it’s not an easy task, that’s why we released the first optimisation (prefetchPageResources API), and will continue until lightboxes are fast enough.

1 Like

And if there is no link to the lightbox on the page, e.g. when you use lightboxes from code to display success or error messages? Can they be prefetched too?

Prefetch them before the visitor is starting the flow that ends with that success message, and preferably after you know they are going to start that flow

@oferr Great, i only say this because we have literally been saying this since Lightboxes were released. That’s all.


@oferr is it possible to prefetch dynamic pages?

@stephenmccall see Ofer’s answer in the other forum:

1 Like

@Ofer is there any development with this? It seems that it has no impact on anyones sites?


Unfortunately, after extensive testing and giving it time to settle as a new feature, I don’t see any impact at all with this optimisation technique for both Pages and Lightboxes.

I have added it and tested it in a number of sites - which i have now removed it form. Makes no difference.

1 Like

Hi @Stephen, @Robert,
The impact is mostly on slow networks, so I would suggest checking it on 3G.
4G visitors won’t feel much difference, but for the 3G visitors it can save a few seconds when loading the page.

Now you should decide:
On one hand, I guess importing wixSite from the wix-site module takes some milliseconds and on the other hand pre-fetching saves some milliseconds and both are unnoticeable in most cases. What would you do? Save a few ms of the 1st page loading time by not importing wixSite or save the a few ms of the 2nd page by pre-fetching.

1 Like

I We are not talking about milliseconds … we talking about 1 / 2 seconds. From click to appearance on a fast wifi network. I don’t see any difference between with to without prefetch.

Has anything come of improving the UX for lightboxes. A lightbox is a great solution for many kinds of menuing, popouts or custom input but they appear to be dead slow? Is there a cure?