Live demo on my site as well @ https://pokatheme.com/
Show HN: Make your site’s pages instant in one minute
251–260 of 361 posts
Re: Show HN: Make your site’s pages instant in one minute
#252Nice idea for HTTP/1.x, however, isn't this what HTTP/2.0 [1] is meant to achieve by pushing components at the user? 1: https://en.wikipedia.org/wiki/HTTP/2_Server_Push
The main difference being that instant.page respects users' data allowances by prefetching only resources that it thinks the user intends to load. You could combine it with H2 push and/or prefetch response headers to improve the load times even more :)
Re: Show HN: Make your site’s pages instant in one minute
#253Re: Show HN: Make your site’s pages instant in one minute
#254Earlier quoted context omitted.
Client side canceled doesn’t necessarily translate to server side canceled. I used to use a preload-on-hover trick like this but decided to remove it once we started getting a lot of traffic. I was afraid I’d overload the server.
I'd also hesitate wasting resources in such a way. About your first statement though, which server software do you use that still sends data after the client has closed the connection? Doesn't it use hearbeats based on ACKs?
Re: Show HN: Make your site’s pages instant in one minute
#255Re: Show HN: Make your site’s pages instant in one minute
#256Earlier quoted context omitted.
Minification is free and is done only once. In our case, the script is .9kb compressed (2.9kb uncompressed). When minified, it goes down to .6kb compressed (1.1kb uncompressed). It’s a small improvement, but there’s no reason to ignore it.
Saves over 50% of bandwidth ... "it's a small improvement". ^_^
Both are under MTU size of TCP packet.
Re: Show HN: Make your site’s pages instant in one minute
#257Earlier quoted context omitted.
OP’s point was that logout should not be implemented with a link/GET but instead with a button/POST for exactly this reason.
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.
A GET request should never, ever change state. No buts.
Just because a bunch of well known sites use GET /logout to logout does not make it correct.
Doing anything else as demonstrated in this and other cases breaks web protocols, the right thing to do is:
GET /logout returns a page with a form button to logout POST /logout logs you out
Re: Show HN: Make your site’s pages instant in one minute
#258Re: Show HN: Make your site’s pages instant in one minute
#259Earlier quoted context omitted.
I've seen this kind of features several times on libs. And sometimes I can't un-think about it while my mouse is hovering on links in normal life. It's .. prefetching or not?
Hmm, I wonder: if the user isn't asked to authorise the action whether it technically breaches the Computer Misuse Act (UK). If you send a requested page, that's obviously fine. Normal use of websites is expected, but unilaterally instructing your site visitor's browser to download further unrequested content that's not part of a requested resource ...?
Re: Show HN: Make your site’s pages instant in one minute
#260This is a good optimization. However, it is like pushing the mud under the carpet. It’ll hide real problem. I would rather fix the root cause of slow rendering pages and then use this trick to make it better.
But you make an important point.