We all want our websites to be fast. We optimize images, create CSS sprites, use CDN (Content Delivery Network), aggressively cache, minimize static content and compress via gzip. We simply use all the long-known tricks.
Still, we can do more. If we want to get faster results, we have to think differently. What if our users didn’t have to stare blankly at a spinning carousel before content was delivered to them? What if we could predict where they want to go next? What if we could have content ready for them even before they even ask for it?
We tend to view the web as a reactive model where every action triggers a reaction. The user clicks and we then take them to a new page. He clicks again and we open another page. However, we can do better. With predictive browsing, we can be more proactive.
Three great techniques
The term predictive browsing ( abbreviated prebrowsing ) was first used by Steve Souders in one of his articles from November 2013. Predictive browsing is nothing more than being able to predict where users will want to go and prepare content for them in advance that they are likely to require . It’s a huge step forward towards a faster and less obvious internet.
Browsers can analyze patterns and predict where users are likely to go next, so they can initiate DNS resolution and initial TCP handshakes as soon as users hover over links. However, to get the most out of these improvements, we can turn on predictive bro
wsing on our Whenever we know that our users are likely to request some resource from a domain other than where our site is, we can warm up the machinery used to open new URLs thailand phone number data by prefetching DNS. The browser can resolve the new domain’s DNS ahead of time, saving a few milliseconds when the user actually requests it. We anticipate the event and prepare for it.
Modern browsers are very good at parsing
Our pages, they are predictive so they resolve all necessary domains ahead of time. Chrome even goes so far as to maintain an internal list of all related domains every time a user visits a website and pre-resolves them when the user returns (you can see this list by going to chrome in your Chrome, access to new URLs can sometimes the price also has a number of variables: be hidden behind redirects or embedded in JavaScript, and this is our opportunity to help the browser.
Let’s say we’re using a JavaScript call to download a set of resources from cdn.example.com after the user cg leads clicks a button. Normally, the browser would have to resolve DNS only at the moment of the click.