Re:Show HN: Make your site’s pages instant in one minute
by fwip on Sunday February 10, 2019 @01:19AM
(#19126600)
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. :/
Re:Show HN: Make your site’s pages instant in one minute
by aruggirello on Sunday February 10, 2019 @06:33AM
(#19127398)
Perhaps the author could add a script parameter, or support an optional 'preload-cache-for' attribute, so you'd write <a preload-cache-for="300s" ...>
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.
Re:Show HN: Make your site’s pages instant in one minute
by dharmab on Sunday February 10, 2019 @03:11PM
(#19129707)
Cache-Control headers already do a better job of solving that problem https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...
Re:Show HN: Make your site’s pages instant in one minute
by ajsharp on Sunday February 10, 2019 @10:11AM
(#19128057)
Set your http cache headers correctly to instruct the client to save and re-use pages it downloads.
Re:Show HN: Make your site’s pages instant in one minute
by WestCoastJustin on Sunday February 10, 2019 @12:11PM
(#19128654)
Yeah, this is likely something I need to look into. Since the site changes quite a bit for, non-logged vs logged, I'm not really doing much html caching right now. I'll check that out though. Even if I added something like 30 second cache TTL that might work. I'd have to see if that is even possible and test though. Maybe force an update on login? I'm not a html cache pro so I'd need to see what the options are and then do some testing. For now, it was just fast enough / not worth the time, to do anything other than a fresh page for each request. But, this is a good suggestion. Thanks.
ps. I do tons of caching for any images and videos though. I know those things never change so have weeks of caching enabled.
Re:Show HN: Make your site’s pages instant in one minute
by threatofrain on Sunday February 10, 2019 @04:47AM
(#19127094)
But how do you know it's still fresh?
Re:Show HN: Make your site’s pages instant in one minute
by Piskvorrr on Sunday February 10, 2019 @06:33AM
(#19127396)
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
by harrisonjackson on Saturday February 09, 2019 @05:35PM
(#19125123)
Very impressive! Wonder if it'd be worth rerouting some of the paginated URLs like the episodes `?page=4` to `/page-4` or something like that. :shrug: - either way, looks like you had some fun optimizing it!
Re:Show HN: Make your site’s pages instant in one minute
by merkaloid on Sunday February 10, 2019 @10:25AM
(#19128102)
/page/4 would probably be more prudent
Re:Show HN: Make your site’s pages instant in one minute
by harrisonjackson on Saturday February 16, 2019 @10:30AM
(#19178984)
I don't like this as much since a savvy user might then try to navigate to /pages/ - which has what on it?
Re:Show HN: Make your site’s pages instant in one minute
by WestCoastJustin on Saturday February 09, 2019 @06:32PM
(#19125402)
Good idea. I'll check that out! Thanks.
Re:Show HN: Make your site’s pages instant in one minute
by dieulot on Sunday February 10, 2019 @12:54PM
(#19128966)
I just released version 1.1.0 which allows whitelisting specific links with query strings like those. https://instant.page/blacklist
Re:Show HN: Make your site’s pages instant in one minute
by WestCoastJustin on Sunday February 10, 2019 @01:05PM
(#19129037)
Awesome, thank you!
Re:Show HN: Make your site’s pages instant in one minute
by m0zg on Saturday February 09, 2019 @03:17PM
(#19124339)
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
by ehsankia on Sunday February 10, 2019 @01:02AM
(#19126568)
I like that there's an extra optimization where it cancels the preload if your cursor leaves and the prefetch hasn't finished it. Would help on really slow networks and pages that timeout.
Re:Show HN: Make your site’s pages instant in one minute
by totony on Saturday February 09, 2019 @04:58PM
(#19124897)
nothing on my network tab in ff 65.0
Re:Show HN: Make your site’s pages instant in one minute
by SCdF on Saturday February 09, 2019 @05:12PM
(#19124986)
ditto. It works on Chrome though (sigh)
Re:Show HN: Make your site’s pages instant in one minute
by sneak on Saturday February 09, 2019 @11:48PM
(#19126408)
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?
Re:Show HN: Make your site’s pages instant in one minute
by amenod on Sunday February 10, 2019 @05:03AM
(#19127138)
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
by calibas on Saturday February 09, 2019 @08:24PM
(#19125838)
Not working for me either, Chrome works great though.
Re:Show HN: Make your site’s pages instant in one minute
by SquareWheel on Saturday February 09, 2019 @10:05PM
(#19126157)
Embedding base64 images isn't really more efficient on HTTP/2 servers. Base64 adds overhead, and multiplexing mitigates the cost of additional network requests.
Re:Show HN: Make your site’s pages instant in one minute
by ponyfleisch on Sunday February 10, 2019 @01:46AM
(#19126659)
But unless you use server push, it still is an additional roundtrip.
Re:Show HN: Make your site’s pages instant in one minute
by dalore on Wednesday February 13, 2019 @11:37AM
(#19154317)
Yes but since it's multiplexed into the same tcp stream it doesn't suffer from slow start and so the tcp window is already large so it's not as bad as it would be on http1.
Re:Show HN: Make your site’s pages instant in one minute
by WestCoastJustin on Monday February 11, 2019 @05:37PM
(#19139137)
UPDATE - Feb 11. I removed the include for now. I was seeing a weird caching issue when people login/logout where the navbar would not update correctly (for the first few requests after). I'm still digging into this. I likely need to invalidate the browser cache some how. Doing some research to see what the options are.
Re:Show HN: Make your site’s pages instant in one minute
by bradknowles on Monday February 11, 2019 @06:51PM
(#19139709)
Have you signed up for a page speed monitoring service, like https://speedmonitor.io/ ?
I'd be very curious to know what your performance looks like over time, especially as it relates to various improvements that you try out.
Re:Show HN: Make your site’s pages instant in one minute
by bradknowles on Monday February 11, 2019 @11:45PM
(#19141109)
Or maybe Pingdom, NewRelic, or gtmetrix?
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 strip comments at the template parse level (working on that now).
pps. I was using https://developers.google.com/speed/pagespeed/insights/ to debug page speed before. Then working down the list of its suggestions. Scoring 98/100 on mobile and 100/100 on desktop. I ended up inlining some css, most images are converted to base64 and inlined (no extra http calls), heavy cache of db results on the backend, wrote the CMS in Go, using a CDN (with content cache), all to get to sub 100ms page loads. Pretty hilarious when you think about it but it works pretty well.