Live data from Hacker News

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

instant.page

301–310 of 361 posts

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

#302
post #277

It would be great to deploy this on hacker news itself, at least on the "see comments" link of the main page. Page-loading is already blazingly fast, but my latency is still a bit high as I use a mobile internet connection.

You could try injecting the script yourself using a chrome extension. https://chrome.google.com/webstore/detail/custom-javascript-...

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

#303
post #91

Earlier quoted context omitted.

You could obviously do it with JavaScript by pinging the server to tell him that log entry X is to be promoted to a true "hit". For a non-JS solution, I guess an tiny iframe at the bottom of the html page that accesses a special server page with an unique stamp that causes the same "hit". the iframe loading would mean that the rest of the page is mostly loaded before it was closed.

> For a non-JS solution How do you use this library with JS disabled?

The iframe would have to be part of the HTML document from the very start. Maybe a server-side pre-processor that appends it as it's served.

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

#304
post #273

Earlier quoted context omitted.

Not if the server is setup correctly.

I don't think it cancels database queries.

Depending on the framework it can. That's the purpose of the golang Context and C# CancellationToken.

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

#305
post #292

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…

If I mouse-over the same link 10 times, it looks in my network tab like it downloads the link 10 times. I'd expect this preload script to remember the pages it's already fetched and not duplicate work unnecessarily. :/

But how do you know it's still fresh?

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

#306
post #282
post #227

Earlier quoted context omitted.

ditto. It works on Chrome though (sigh)

Why the sigh? It says right on the site that this gracefully degrades on browsers that don’t support it. Why is it a problem making a site faster in a browser designed for speed, if it does not degrade the experience at all in all other browsers?

That is OK, if you are talking about older browsers or browsers on limited / obscure platforms. Firefox doesn't fit the bill, and optimizing the site just for ~~IE~~ Chrome hurts the FF users and makes Chrome win even more - leading to self-fulfilling claim that Chrome is faster. It's not, but it will be if people optimize for it. This is one of the reasons I make a point to always develop in Firefox and later just check in Chrome (note that I still do check, because majority of people use it) - apart from simply better experience of course. :)

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

#307
post #275

Earlier quoted context omitted.

Lots of people in this thread confusing “idempotent” with “safe” as specified in the HTTP RFC: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

FWIW RFC 2616 was obsoleted by the newer HTTP/1.1 RFCs: https://tools.ietf.org/html/rfc7231#section-4.2

Which still doesn't change GP's point though:

> In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe".

(there's an exception listed too, but doesn't apply to logout)

EDIT: I know of someone who made a backup of their wiki by simply doing a crawl - only to find out later that "delete this page" was implemented as links, and that the confirmation dialog only triggered if you had JS enabled. It was fun restoring the system.

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

#308

Earlier quoted context omitted.

A logout action is idempotent, though. You can't get logged out twice. In my opinion, that's the use case for a GET request. I just checked NewRelic, Twilio, Stripe and GitHub. The first 3 logged out with a GET request and GitHub used a POST.

Also: sometimes a site is misbehaving (for myself, or maybe for a user we're helping) and it's helpful to directly navigate to /logout just to know everyone is rowing in the same direction. Using a POST, especially if you're building through a framework that automatically applies CSRF to your forms, forecloses this possibility (unless you maintain a separate secret GET-supporting logout endpoint, I guess).

When I originally started my community site I used GET for logout. However, users started trolling each other by posting links to log people out. It wasn't easy to control, because a user could post a link to a completely different site, which would then redirect to the logout link. So, I switched to POST with CSRF and never had another issue.

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

#309
post #292

Earlier quoted context omitted.

If I mouse-over the same link 10 times, it looks in my network tab like it downloads the link 10 times. I'd expect this preload script to remember the pages it's already fetched and not duplicate work unnecessarily. :/

But how do you know it's still fresh?

HTTP has multiple cache control headers. It's a fairly complex topic, but TL;DR: do the config and it works in any browser since ~2000 (yes, even IE6).

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

#310
post #292

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…

If I mouse-over the same link 10 times, it looks in my network tab like it downloads the link 10 times. I'd expect this preload script to remember the pages it's already fetched and not duplicate work unnecessarily. :/

Perhaps the author could add a script parameter, or support an optional 'preload-cache-for' attribute, so you'd write

If you really care about speed anyway, you should already have setup your site to max out caching opportunities (Etag, Last-modified, and replying "not-modified" to "if-modified-since" queries) - I'd suggest the author should ensure the script does support caching to the broadest extent possible - hitting your site whenever appropriate.

Post reply on HN