How to load pages instantly with Instant.Page? (2022)
Do you want to improve your website speed whether Wordpress or Blogger, then this article is for you? Here I will show you how you can instantly load URL on a website by implementing an instant click feature.
Here, we will use the instant.page library to speed up our website speed by implementing URL prefetch. It is an open-source library developed by Alexandre Dieulot.
▷ Table of content
- How Instant page link preload works?
- How to implement Instant-page preloading in Blogger?
- How to install the Instant.page in WordPress?
- Browser support and security
- Additional options with data attributes
How Instant page link preload works?
Instant.page preloads the page just before the user clicks on it. When a user hovers over a link, it will start loading the HTML part of that webpage in the background and it can save 100 milliseconds of latency.
The "just-in-time preloading" feature of the instant page improves the user experience on the website by loading the webpage at lightning-fast speed.
On the desktop, when a visitor hovers the mouse on the link just before the click, it will start the preloading and save around 300 ms in the loading process.
You can also load the page after the user clicks on a link and it will not utilize additional requests, still, it can improve page loading speed by 80ms on average.
You can also start preloading links when it comes in the viewport but I will not recommend this as it can take more server bandwidth.
Mouse hover preload is the best option as it preloads HTML files only when a user hovers on a link more than 65ms.
It also works in the same fundamentals in Mobile devices. It will start loading the page in the time gap of when someone touches his display before releasing it. Here it can improve page speed by 90ms on average.
Does this affect server bandwidth?
No, it will not affect the server bandwidth that much as it preload only when there is a good chance that a user will click on a link.
How to implement Instant-page preloading in Blogger?
You can easily install the instant-page script on your blogger website by following the below method.
- Go to the Blogger dashboard > theme > Edit HTML
- Now click on code area and type CTRL+F to search </body> tag.
<script src="//instant.page/5.1.0" type="module" integrity="sha384-by67kQnR+pyfy8yWP4kPO12fHKRLHZPfEsiSXR8u2IKcTdxD805MGUXBzVPnkLHw"></script>
Now you have successfully added the instant click functionality in your Blogger website. Now it will prefetch the URLs of your site just before the click.
How to install the Instant.page in WordPress?
You can implement instant page functionality in WordPress easily by adding a lightweight plugin.
To install instant page plugin in WordPress site:
- Go to WordPress dashboard > Plugins > Add New
- Now search for instant page plugin
- Install and activate this plugin.
Now, this link (URL) preloading feature of the instant.page is activated on your WordPress website.
Here note that you can enable the same feature using a caching plugin like LiteSpeed cache, Perfmatters, etc.
Browser support and security
It will support all chromium-based browsers like chrome, Microsoft edge, Brave and Firefox, etc. It won't break your site on unsupported browsers like safari, internet explorer.
It is completely secure and it is hosted serverless with Cloudflare workers.
You can also self-hosted this on your server by downloading the latest version of the JS file from the official site and add a module script tag just before the </body> tag in the below format.
<script src="instantpage-5.1.0.js" type="module" defer></script>
Additional options with data attributes
By default, this code works with internal links only but you can enable it for external links using single data instant attributes.
Here is the list of data attributes that you can use.
data-instant-allow-query-string data-instant-allow-external-links data-instant-whitelist data-instant-intensity="mousedown" data-instant-intensity="mousedown-only" data-instant-intensity="150" data-instant-intensity="viewport" data-instant-intensity="viewport-all" data-instant-mousedown-shortcut
<a href="https://domain.com/post" data-no-instant>Post</a>
I hope you got the idea about how the instant click function work and how you can implement instant.page script in both blogger and wordpress websites.
It will greatly improve the user experience by loading the web pages inside your website with lightning-fast speed.
You can also improve the page speed of your Blogger website by following the below articles.
If you have any doubt you can ask me in the comment section. Also, don't forget to subscribe to our YouTube channel for more Speed improvement Guides.