9 ms·
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
by js4ever 8y ago
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
- mariopt 8y agoThe analytics should only be triggered is the page is rendered, assuming it's done client side. I believe Google does this for first top 3 results if I'm not mistaken.
- michaelbuckbee 8y agoThis helped me quite a bit, my mental model of how this worked was off. Prefetching only downloads the resources but does not actually execute any js code. So sites doing lots of tag managers or other js loading js likely wouldn't benefit, but standard GA, etc. should be fine.
- hombre_fatal 8y agoGood point. What would be a good way to avoid prefetch requests in your analytics if you only derive analytics from server access logs?
- 8bitben 8y agoMost browsers pass a "purpose:prefetch" or similar HTTP header in the prefetch request that you can use to differentiate
- hueving 8y agoThen how do you know when they actually go to the page? Do you need client side analytics at that point since the browser already has the page in memory?
- Drakim 8y agoYou 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.
- dspillett 8y agoAdded bonus: these extra pre-loads on hover will tell you if someone nearly clicked a link. Your web server logs contain some poor-man's eye tracking. Could aid determining if important parts of your pages (warning messages and so forth) gather enough attention.
- sleavey 8y agoSeems like an invasion of privacy. I'd be surprised if someone hadn't used this sort of script for this already. Perhaps browsers or ad blockers will block this feature in the future.
- ohmatt 8y agoThere's already other libraries out there like Fullstory, which tracks all the user mouse movements and interactions with the page and allows you to watch a user interact with your site in nearly realtime.
- dspillett 8y agoThere are full tracking tools that do a lot more than this already - tracking all mouse movements and key presses. They are often used with the knowledge of users when testing UI changes/experiments, I've even heard of more general versions running as a browser plug-in for medical monitoring (watching for changes in coordination of people with degenerative conditions, without it feeling like an active test accidentally biasing results), though I would also be surprised not to find the idea already used more widely (and perhaps more nefariously) without users knowing.
- mygo 8y agoIf a GET request is all it takes for your analytics to be messed up, then your analytics are not reliable in this era of bots pinging everything. You need to be emitting your analytics events from a rendered/executed page. Preferably with javascript, and a fallback <noscript> resource link to a tracking url can work here.
- chatmasta 8y agoMight 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?
- drewmol 8y agoSo would setting erroneous pre fetch headers to all requests would help to spoil analytics insights?
- byron_fast 8y agoWhat's more important - analytics, or the user experience. Damaging stats sucks, but this seems to outweigh that.
- dentemple 8y agoClearly you're not in middle management.
- aiisjustanif 8y agoWithout analytics, I don't justify my project soooo
- williamdclt 8y agoIn a lot of legit cases, analytics. Especially versus a UX improvement that is clearly minor. The word "analytics" has bad rep but it's massively important to know if you're building the right product for your users, without a sort of analytics you're shooting in the dark