Lurker News

Comments (337) 70 threads

Earlier comments
mars4rp2 replies#
This is very nice idea, but isn't the problem initial liad time most of the time? How could we solve that?

Does this also work for all the outgoing links as well? I don't want to improve other sites rendering time at the expense of my own.
Very cool regardless.

dieulot#
It doesn’t work for outgoing links because the gain wouldn’t be as much as the CSS and scripts of the external site need to be loaded in addition to the HTML (only the HTML can be preloaded).

Also, there’s usually no incentive to improve other’s sites pages load.

s3krit#
>but isn't the problem initial liad time most of the time? How could we solve that?

Off the top of my head, a good way seems to be to write better sites that don't include 10mb of javascript libraries.

randlet1 reply#
Works very well for me.

dieulot, is there a small bug with the allowQueryString check?

    const allowQueryString = 'instantAllowQueryString' in document.body.dataset
I think should be:

    const allowQueryString = 'instantallowquerystring' in document.body.dataset

If I have:


then

    'instantAllowQueryString' in document.body.dataset === false
and

    'instantallowquerystring' in document.body.dataset === true
because html data attributes get converted to lowercase by the browser (I think).
dieulot1 reply#
Uppercase is converted to added dashes. `document.body.dataset.instantAllowQueryString` corresponds to `data-instant-allow-query-string`.
randlet#
Cool thanks! Didn't know that.
sfusato1 reply#
What would be the best way to integrate this in an app that already uses Turbolinks?
ksec#
Exactly my thought. May be even better is to have it included in the next version of Turbolinks.

Load more comments