Clickbait title right? 😉
Released 4 months ago, the script is currently used by 4k WordPress sites.
gijo-varghese
/
flying-pages
Load inner pages instantly, intelligently
Flying Pages
Flying Pages prefetch pages before the user click on links, making them load instantly
Quick Links
- Demo: Open https://wpspeedmatters.com and click on any post
- WordPress Plugin
- Quicklink vs Instant page vs Flying Pages
- Join our Facebook Group, a community of WordPress speed enthusiasts
Usage
Quickstart:
<script src="flying-pages.min.js"></script>
With options:
<script>
window.FPConfig = {
delay: 0,
ignoreKeywords: [],
maxRPS: 3,
hoverDelay: 50,
};
</script>
<script defer src="flying-pages.min.js"></script>
-
delay: Start prefetching after a delay (in seconds). Will be started when the browser becomes idle, usingrequestIdleCallback. Default to 0. -
ignoreKeywords: An array of keywords to ignore from prefetching. Example['/logout','/cart','about.html','sample.png','#']. -
maxRPS: Maximum requests per second the queue should process. Set to 0…
<script src="flying-pages.min.js"></script>
<script>
flyingPages({
delay: 0,
ignoreKeywords: [],
maxRPS: 3,
hoverDelay: 50
});
</script>
How it works?
Flying Pages injects a tiny JavaScript code (1KB gzipped) that waits until the browser becomes idle, detect links in the viewport (also on mouse hover) and prefetch them so that browser doesn't have to wait while navigating through pages.
The prefetching is done using the prefetch tag:
<link rel="prefetch" href="URL_TO_PAGE">
Prefetch pages in the viewport – Detect links within the viewport (current viewing area) using ‘Intersection Observer’ and tells the browser to prefetch them using ‘prefetch’
Prefetch pages on mouse hover – On hovering links, if it’s not prefetched yet using above ‘viewport’, then Flying Pages will prefetch them instantly (similar to Instant.page).
Limits the number of prefetches per second – If your page has too many links, prefetching all at the same time will cause the server to crash or slow down the website to visitors. Flying Pages limits the number of prefetches per second (3 req/sec by default) using an in-built queue.
Stops prefetching if the server is busy – In case the server starts to respond slowly or return errors, prefetching will be stopped to reduce the server load.
Understands user’s connection and preferences – Checks if the user is on a slow connection like 2G or has enabled data-saver. Flying Pages won’t prefetch anything in this case.
WordPress Plugin
Prefetching links to logout, cart page etc can cause issues. So we need to exclude such links as well as few other options like:
- Set maximum requests per second
- Delay to start prefetching
- Mouse hover delay
- Disable for logged in admins
The Flying Pages WordPress plugin comes with a settings panel to configure all these:
Demo?
Check out my blog WP Speed Matters




Latest comments (30)
Great plugin thinking to implement it on my blog bloggingidol.com.
Interesting plugin,Thanks :) Some points and question:
In this post you are saying
preloadand usingprefetchtag , its confusing for reader becausepreloadandprefetchare different concepts.I tested your demo website home page:
In home page after load, I took a full screenshot , its here, As you can see initially all images are blank , as we scroll it loads the image, so does this plugin just lazy loads images ?
I click on a article, I expected whole article to be cached using
prefetchin browser, but in network tab i can see it is pulling the html from server instead.Can you create separate demo website for the plugin with little assets and articles and explain step by step why this plugin is useful.
2.1 - The images are lazy loading using my other plugin, Flying Images. Flying Pages doesn't lazy load images.
2.2 - On clicking prefetched article, it will still show in the network tab, but the 'size' would be 'prefetch cache'. Make sure "Disable Cache" is unchecked. Here is how you can check if it's working properly or not: youtube.com/watch?v=T658UlOKdx8
Thanks for the plugin. I have implemented it on my website. wplogout.com
It is working like a charm. Thanks, Gijo.
Thank you. I applied your wordpress plugin on my sites
Awesome!
Nice and Awesome.
Loved. Thanks Developer
hello how does it handle google adsense ads ?
Flying Pages doesn't preload external links. So there won't be any issue with Ads
If you open the network tools and open a link, you'll see size as "preload cache". Test it out in an incognito window if you've disabled it for admins
Flying Pages doesn't decrease the load time of the page. It only speeds up inner page navigation. That is when you open the site and click on any link
Wow, didn't know about this tool! Thanks!
Welcome :)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.