user's experience into key actions. RAIL's goals and guidelines aim to help developers and designers ensure a good user experience for each of these actions. By laying out a structure for thinking about performance, RAIL enables designers and developers to reliably target the work that has the highest impact on user experience.
input in under 100ms • Produce a frame in under 10ms when animating or scrolling • Maximise main thread idle time • Load interactive content in under 5000ms
of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, and more.
IntersectionObserver( // Pre-load items that are within 2 multiples of the visible viewport height. function(changes) { changes.forEach(function(change) { var container = change.target; var content = container.querySelector("template").content; container.appendChild(content); observer.unobserve(container); }); }, { rootMargin: "200% 0%" } ); // Set up lazy loading query(".lazy-loaded").forEach(function(item) { observer.observe(item); });