Next.js: with-prefetching example is not prefetching

Created on 1 Mar 2017  路  7Comments  路  Source: vercel/next.js

Hi,
I just downloaded the example code and ran it as is and I'm not seeing any kind of prefetch (nor the "prefetch using the declarative API" or the "imperatively prefetch on hover"). There is something I should to do so it starts working? (I was trying to make prefetch work in my code and after I failed I download this just to see how is was made). I've tried in Chrome, Safari and Firefox.

1

All 7 comments

Prefetching uses ServiceWorkers, and as far as I know SW requires HTTPS to work, try deploying to now.sh.

Thanks @sergiodxa. I think SW should work without HTTPS under localhost. But I'll check.

Well, that was the issue :)
The weird think is that everywhere says that "during development you'll be able to use service worker through localhost" 馃

If the prefetch depends totally on SW, it means that it will not work at all on iOS and/or Safari? Is not a way to achieve some similar preloading of those files?

Just found out this thread: https://github.com/zeit/next.js/issues/436 馃槥
To leave that really high percentage of user on iOS/Safari/IE without the amazing (almost critical) prefetch feature, do you think with can achieve something like this stackoverflow answers?

Prefetching uses ServiceWorkers, and as far as I know SW requires HTTPS to work, try deploying to now.sh.

@coluccini @sergiodxa We no longer use SW and prefetching should work everywhere.
But now it only works on production. (next dev && next start)

I'm so happy to read that @arunoda ! thanks so much (for the answer and for your awesome work on next)! :)

So, I'm closing this issue.
Re-open if the issue exist still.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sospedra picture sospedra  路  3Comments

irrigator picture irrigator  路  3Comments

lixiaoyan picture lixiaoyan  路  3Comments

jesselee34 picture jesselee34  路  3Comments

wagerfield picture wagerfield  路  3Comments