Live data from Hacker News

Show HN: Make your site’s pages instant in one minute

instant.page

191–200 of 361 posts

Re: Show HN: Make your site’s pages instant in one minute

#192

Earlier quoted context omitted.

> There's nothing stopping GET requests from having side effects. > It's like pointing to a list of best practices and saying "everyone surely follows these." It’s not a ‘best practice’ it’s literally the spec for the web.

What percent of developers do you think have even read the RFC? Browsers take a more practical approach than "well, it's in the spec, they should know better" which is apparently what you're suggesting. It's the same reason browsers will do their best to render completely ridiculous (much less spec-complaint) HTML.

To prove your point: If I remember correctly HN votes are sent as GET.

Re: Show HN: Make your site’s pages instant in one minute

#193

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 att…

Uppercase is converted to added dashes. `document.body.dataset.instantAllowQueryString` corresponds to `data-instant-allow-query-string`.

Cool thanks! Didn't know that.

Re: Show HN: Make your site’s pages instant in one minute

#194

Live demo on my website @ https://sysadmincasts.com/ Temporary added it in-line for testing. I was already in the sub 100ms level but this just puts it over the top! Also updated all admin add/edit/delete/toggle/logout links with "data-no-instant". Pretty easy. Open developer preview and watch the network tab. Pretty neat to watch it prefetch! Thanks for creating this! ps. Working on adding the license comment. I str…

This is what the OP should have posted. Very impressive. Will use in my work.

Re: Show HN: Make your site’s pages instant in one minute

#196
post #45

Each time you hover over a link it's doing a GET request bypassing the cache (cache-control: max-age), even if you hove the same multiple times. Also this will make all your analytics false... Except that indeed this can improve greatly the user sensation of speed

Might be worth adding something like a Pre-Fetch: True header to pre-fetched requests. But then the problem is, if the user pre-fetches and then actually views it, how does your analytics know unless the client then sends another request?

Re: Show HN: Make your site’s pages instant in one minute

#197
Will this cause problems with "links" that are entirely rendered on the client side? i.e. using something like react-router... In that case, could it result in the react app setting invalid state because it thinks the user is on a page when it's not?

My guess is what would happen when "pre-fetching" a react-router link, is that it would prefetch the JS bundle all over again for no gain.

Re: Show HN: Make your site’s pages instant in one minute

#198

Embedding via // without explicit SSL should probably be considered harmful or malicious as there is no reason to make such scripts available without SSL. Even if the end website is not using SSL users can still fetch your script securely.

No! You should NEVER load javascript over https on a page that was served over http. It gives a false sense of security that doesn't exist. Because the source page was served over http, the source page can be modified by an attacker, making the script be loaded under ssl makes you think its protected. But its not since an attacker could just modify the script tag to remove the https bit in transit then modify the scr…

No browsers present that to users as a secure context, so nobody is being tricked.

More HTTPS == Better. If you can load this over HTTPS you should, no matter what circumstance. The browsers iconography will handle notifying people when the context is secure or not.

Re: Show HN: Make your site’s pages instant in one minute

#200

I have just added it to a Shopify store to try it and it does indeed speed things up! However I am a little concerned with adding a script from another website... it requires a lot of trust, doesn'it?

As another comment mentioned, you can just host the script on your own site.
Post reply on HN