instantpage / instant.page

Make your site’s pages instant in 1 minute and improve your conversion rate by 1%
https://instant.page
MIT License
6.04k stars 205 forks source link

Doesn't work in Firefox without cache headers #7

Open skorokithakis opened 5 years ago

skorokithakis commented 5 years ago

I know you're aware of this, but can we have an issue to track the problem?

dieulot commented 5 years ago

Sure. I reported the bug to Mozilla. Currently they consider it normal for it not to work. I explained the use case and am waiting for an answer.

skorokithakis commented 5 years ago

Thanks for the follow-up! So basically it's not that it doesn't work, they just don't cache the page past what its headers specify. Let's see what happens.

TehShrike commented 5 years ago

I added instant.page 1.1.0 to my home page, and the prefetching doesn't seem to be working in Firefox even when cache headers are set: https://joshduff.com/

Works niftily in Chrome, though.

TehShrike commented 5 years ago

Never mind – the issue went away when I updated Firefox :-x

PikachuEXE commented 5 years ago

@TehShrike What versions are you using? (the one working and the one not working) Would be good to know which versions of Firefox are compatible with this library (and state it in website)

TehShrike commented 5 years ago

It's actually still not working on my Windows machine, on Firefox 65.0.1 :-o

(When I mouse over a link, there is no network request made)

dieulot commented 5 years ago

Are you using uBlock Origin? I found out two days ago that it disables prefetching on Firefox. (I plan on adding a mention on the website.) I reported this to uBlock Origin asking if they could allow same-origin, unfortunately there’s no way.

TehShrike commented 5 years ago

@dieulot good call! I did have uBlock on my Windows machine. I disabled uBlock and tried again, and it worked as expected. Thanks for figuring that out.

dieulot commented 5 years ago

The bug has been acknowledged by Mozilla. It’s P3 (low priority) and depends on a refactoring, so I guess we’ll have to wait quite a bit before it’s resolved.

Nicholas-Cardot commented 4 years ago

Is there a way to detect if this isn't going to work and disable it when so? Right now, it just pings the server twice, doubling the load on the server. Once for the hover and once for the click.

kittenswolf commented 4 years ago

Sounds like a simple useragent check for now

dieulot commented 4 years ago

Yeah, I’ll do an option to disable it on Firefox for now.

Calinou commented 4 years ago

@dieulot This may be out of scope for instant.page, but wouldn't using fetch() instead of link rel="prefetch" bypass the issue with uBlock Origin on Firefox? fetch() has different semantics from prefetch (it's higher-priority), but it should technically be able to do the job.

uBlock Origin on Firefox disables prefetching on every startup, so even if you enable network.prefetch-next manually in about:config, it will be disabled again when you restart Firefox :slightly_frowning_face:

dieulot commented 4 years ago

Good idea @Calinou! I’ll look into it.

solarkraft commented 2 years ago

When uBlock origin is enabled (not for the page, enabled in the browser at all!) prefetching doesn't seem to work. But even when it does (showing up in the network inspector), it's not particularly instant at all - it's like nothing was even preloaded :/

Ugh. Nothing has happened on the Firefox bug. Looks like a classic Mozilla move.