{"_id":"flying-pages","_rev":"1-b16c209c72c9eb18cb3af15052ddcf45","name":"flying-pages","dist-tags":{"latest":"2.0.6"},"versions":{"2.0.6":{"name":"flying-pages","version":"2.0.6","description":"Load inner pages instantly, intelligently!","main":"flying-pages.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/gijo-varghese/flying-pages.git"},"keywords":["flying-pages","preload","fast","performance","speed"],"author":{"name":"Gijo Varghese"},"license":"ISC","bugs":{"url":"https://github.com/gijo-varghese/flying-pages/issues"},"homepage":"https://github.com/gijo-varghese/flying-pages#readme","gitHead":"e5ef253333bcc3641581c9ebccd282cd31a7d477","_id":"flying-pages@2.0.6","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-RXK0YJyLNl4eBwm6swKQoZXVbh7K/QuPFiM8X3ooRP5w7eNxQc7J4HkZmTWNVTVzlpb3XuE3AuCByDkePyZvCw==","shasum":"6d50b359c732b21c734c821b49e695ad6c619b14","tarball":"https://registry.npmjs.org/flying-pages/-/flying-pages-2.0.6.tgz","fileCount":5,"unpackedSize":230843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgDDUCRA9TVsSAnZWagAAWg4QAIC19iC48AYtu3O2MYxN\nqte6o1adzWpp7iXT0q04nCPYeQy5rZGA6egYr3avNT6/4IUZLcbdJrh8QCz3\n14WeDksK8dGdqgB++De2iMxIiRQ7Pz1fGjpsW5ZMy3Gum4X/jUY+xettv9M3\nje9iKFhhWAG1bmj7dqYIhIrn81fIhGOVBM8u+uiobh/m9phy3A3xBbVHMfPD\nd60N4V9MO4KH6ee2k6p+1k1M6hlroIBMMaA1SZLaiigppSqfRjAAynCsTUML\nFEygMvkvOovgnaFiEIm2BJiPaX4Zc3hUgerA2QLwPKa3DlQeBWVg7Otggn71\nRBig9ATvwxG5tlcr/XgWwRCtdoqb6VMfyx32DdlxG1m5igPxkucBMERYpa5m\nmK1Pt2VCPIQg52HXfK19OOJSXDNt/3XYfnXbWBvVMG7aFuJ3Bz43MEwrVSt1\nKqq1vtEqrz8Pim3H7Ndrhh7z7hGuWB3L3+Ao85x570uSOiNJCyJO77odIqiU\nkaXsG0TQ/rz+j/GxtZIcozDoRFiN46guedC8wTOrnazefH2F565PsJoIKOaT\n0yb8ZlSqupj+rvPYwGjF/vyLoq63b4mxA+osxNjUL/rGdjQP0/yIQYeimqqc\nY5VLRYCCN6OOV7wrwOTauXoZV7ouyEgklfNLXp0ylWYA2gTUr7Z7u/+Flrmi\nicFL\r\n=dzey\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsBm+EeDXFn8zMRNeGtGg7KWz+KwOqNcYHpp/DNQ/DsAiBukIE5Ea8knjjg/dMByo858Gq0NsLCh02KeQYuinGr6g=="}]},"maintainers":[{"name":"gijovarghese141","email":"gijovarghese141@gmail.com"}],"_npmUser":{"name":"gijovarghese141","email":"gijovarghese141@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flying-pages_2.0.6_1568682195688_0.42726475238413797"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-17T01:03:15.687Z","2.0.6":"2019-09-17T01:03:15.920Z","modified":"2022-05-02T16:42:21.585Z"},"maintainers":[{"name":"gijovarghese141","email":"gijovarghese141@gmail.com"}],"description":"Load inner pages instantly, intelligently!","homepage":"https://github.com/gijo-varghese/flying-pages#readme","keywords":["flying-pages","preload","fast","performance","speed"],"repository":{"type":"git","url":"git+https://github.com/gijo-varghese/flying-pages.git"},"author":{"name":"Gijo Varghese"},"bugs":{"url":"https://github.com/gijo-varghese/flying-pages/issues"},"license":"ISC","readme":"<p align=\"center\">\n  <img src=\"cover.png\">\n</p>\n\n# Flying Pages\n\n> Flying Pages preload pages before the user click on it, making them load instantly\n\n## Quick Links\n\n- Demo: Open [https://wpspeedmatters.com](https://wpspeedmatters.com) and click on any post\n- [WordPress Plugin](https://wordpress.org/plugins/flying-pages/)\n- [Quicklink vs Instant page vs Flying Pages](https://wpspeedmatters.com/quicklink-vs-instant-page-vs-flying-pages/)\n- Join our [Facebook Group](https://www.facebook.com/groups/wpspeedmatters/), a community of WordPress speed enthusiasts\n\n<a href=\"https://www.buymeacoffee.com/gijovarghese\" target=\"_blank\"><img src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" ></a>\n\n## Usage\n\nQuickstart:\n\n```html\n<script src=\"flying-pages.min.js\"></script>\n<script>\n  flyingPages();\n</script>\n```\n\nWith async/defer (recommended):\n\n```html\n<script defer src=\"flying-pages.min.js\"></script>\n<script>\n  window.addEventListener(\"load\", () => {\n    flyingPages();\n  });\n</script>\n```\n\nWith options:\n\n```html\n<script defer src=\"flying-pages.min.js\"></script>\n<script>\n  window.addEventListener(\"load\", () => {\n    flyingPages({\n      delay: 0,\n      ignoreKeywords: [],\n      maxRPS: 3,\n      hoverDelay: 50\n    });\n  });\n</script>\n```\n\n`flyingPages` accepts optional options object with the following parameters:\n\n- `delay`: Start prefetching after a delay (in seconds). Will be started when the browser becomes idle, using `requestIdleCallback`. Default to 0.\n- `ignoreKeywords`: An array of keywords to ignore from prefetching. Example `['/logout','/cart','about.html','sample.png','#']`.\n- `maxRPS`: Maximum requests per second the queue should process. Set to 0 to process all requests immediately (without queue). Default to 3.\n- `hoverDelay`: Delay in prefetching links on mouse hover (in milliseconds). Default 50.\n\n## How it Works?\n\nFlying Pages injects a tiny JavaScript code (1KB gzipped), waits until the browser becomes idle. Then it detects pages in the viewport and on mouse hover and preloads them.\n\nFlying Pages is intelligent to make sure preloading doesn't crash your server or make it slow.\n\n- **Preload pages in the viewport** - Detect links within the viewport (current viewing area) using 'Intersection Observer' and tells the browser to preload them using 'prefetch', switch to xhr if not available (similar to [Quicklink](https://github.com/GoogleChromeLabs/quicklink)).\n\n- **Preload pages on mouse hover** - On hovering links, if it's not preloaded yet using above 'viewport', then Flying Pages will prefetch them instantly (similar to [Instant page](https://instant.page/)).\n\n- **Limits the number of preloads 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 preloads per second (3 req/sec by default) using an in-built queue. For example, if you've 10 links in the viewport, preloading all these are span into 4 seconds.\n\n- **Stops preloading if the server is busy** - In case the server starts to respond slowly or return errors, preloading will be stopped to reduce the server load.\n\n- **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 preload anything in this case.\n","readmeFilename":"readme.md"}