A/B Testing Instant.Page With Netlify and Speedcurve

Learn how to measure the real-world performance impact of Instant.Page using Netlify's split testing and SpeedCurve's real-user monitoring.

Understanding Instant.Page and Its Performance Promise

What Instant.Page Does

Instant.Page does one special thing to make sites faster: it preloads the next page when it's pretty sure you're going to click a link. The script watches for hover events on links and triggers a prefetch after 65 milliseconds of hovering. On mobile devices, it triggers on the touchstart event instead. This means when you actually click the link, the page may already be partially or fully loaded.

The implementation is remarkably lightweight--the entire script is just 1.1 kilobytes when compressed with Brotli. By default, Instant.Page takes a conservative approach, only prefetching when user intent is clear, rather than aggressively prefetching all visible links.

Why Measurement Matters

Understanding the theoretical benefits of a performance optimization is one thing; measuring its actual impact on your specific site is another. The truth is that performance improvements don't always translate uniformly across different websites. Factors like session length, average page weight, user device types, and navigation patterns all influence how much benefit you'll see from prefetching.

A/B testing provides empirical evidence rather than assumptions. By serving one version of your site with Instant.Page to some visitors and a version without it to others, you can compare real-world performance data and make data-driven decisions about whether to keep the optimization.

For sites focused on web performance optimization, understanding the real impact of each optimization is critical for prioritizing improvements that actually move the needle.

Setting Up Branch-Based Split Testing

Prerequisites and Platform Requirements

Before you can run an A/B test for Instant.Page, you'll need a few things in place. First, you'll need a Netlify account with access to split testing functionality. Your site must be connected to a GitHub repository so Netlify can work with branches. You'll need at least two branches--one serving as the control (without Instant.Page) and one serving as the test version (with Instant.Page). Finally, a SpeedCurve account will provide the real-user monitoring capabilities needed to track and compare performance metrics.

Creating the Test Branches

The branch structure for your test should be straightforward. Create a dedicated branch--perhaps called "instant-page"--where you'll implement Instant.Page. Download the script and add it to your site on this branch. Self-hosting the script is recommended to avoid the overhead of an additional external connection and to maintain full control over when and how it loads.

Keep your main or master branch as the control version that doesn't include Instant.Page. This gives you a clean baseline for comparison. Both branches should otherwise be identical in content and structure so that any performance differences can be attributed to the prefetching behavior.

Configuring Netlify Split Testing

Netlify's split testing feature divides traffic between different deploys without impacting download performance. From your site dashboard, navigate to the split testing section and select the branches you want to include in the test. Allocate traffic percentages--many testers start with a 50/50 split for clean comparison, though you can adjust based on your risk tolerance.

Netlify uses a cookie called nf_ab to ensure visitors stay on the same version throughout their session. This cookie contains a random floating-point value between 0 and 1. If you have a 50% split, values between 0.0 and 0.5 will receive one version while values between 0.5 and 1.0 receive the other.

This approach to continuous deployment enables you to test changes safely before committing to them permanently.

Integrating SpeedCurve for Performance Tracking

Setting Up Custom Data Variables

To compare performance between your test versions, you need a way to distinguish which version each visitor saw. SpeedCurve provides the LUX.addData() method for this purpose. This allows you to add custom data variables that get attached to each session's performance data.

Create a custom data variable--perhaps called "instantpage"--that indicates which version of the site the visitor received. Set it to "yes" for the Instant.Page branch and "no" for the control branch. This simple tagging enables you to filter your SpeedCurve dashboards and see performance metrics separated by test group.

Using Snippet Injection for Cleaner Implementation

One of the elegant aspects of this testing approach is that you don't need to modify your source code to add the tracking. Netlify's snippet injection feature lets you inject code either before the closing body tag or before the closing head tag without touching your repository's source files.

Snippet injection supports Liquid templating and exposes build-time variables, including the current branch. You can use this to conditionally inject the appropriate LUX.addData() call based on which branch is being built. This keeps your source code clean while still enabling comprehensive tracking.

Configuring SpeedCurve Data Filters

Once you've implemented the tracking, you need to tell SpeedCurve about your custom data variable. Navigate to the custom data settings in your SpeedCurve dashboard and create a new data variable of type "Other." Enter the variable name you used in your code and a human-readable label. After saving, SpeedCurve will recognize the data and allow you to filter your charts and reports based on which test group each session belonged to.

Integrating performance monitoring with your analytics infrastructure helps connect technical metrics to business outcomes.

Analyzing Test Results

Key Metrics to Monitor

When evaluating the impact of Instant.Page, certain performance metrics deserve particular attention. First CPU Idle measures when the page becomes minimally interactive, which is a good indicator of perceived responsiveness. First Contentful Paint shows when the first content appears on screen, capturing the initial visual experience. Time to Interactive indicates when the page is fully usable, incorporating both visual and functional readiness.

Beyond median values, pay attention to the 95th percentile metrics. These capture the experience of users at the slow end of the spectrum--those on poor network connections or less capable devices. A feature that improves median performance but hurts 95th percentile performance may not be worth implementing, as it could harm your most vulnerable users.

Interpreting the Data

Real test results can be nuanced. In one notable test, First CPU Idle showed a 100-millisecond improvement at the median and a 200-millisecond improvement at the 95th percentile--both wins for Instant.Page. However, First Contentful Paint showed a 300-millisecond improvement at the median but a 100-millisecond regression at the 95th percentile.

These mixed results highlight why real testing matters. The improvements at the median suggest that for typical users, the page becomes interactive faster. But for users at the 95th percentile, the prefetching may be competing with other resource loading, slightly delaying the initial paint. Understanding these trade-offs helps you make informed decisions about whether Instant.Page is right for your specific audience.

Testing Duration and Statistical Significance

Early results shouldn't be considered final. Run your tests long enough to capture varied user behavior across different days of the week and potentially different time zones if your audience is global. New visitors versus returning visitors may also behave differently, as returning visitors may have cached resources that interact differently with prefetching.

Watch for anomalies in your data--unusual spikes or drops that may skew results before you've accumulated enough data to smooth out these variations. Depending on your traffic volume, you may need several days or even weeks to reach statistical significance.

Consistent performance monitoring helps you spot these patterns and make informed optimization decisions.

Best Practices for Performance A/B Testing

Testing on Your Own Site

Perhaps the most important principle in performance testing is recognizing that results from one site don't automatically apply to others. A performance optimization that shows great results on a content-heavy blog may behave differently on an e-commerce site with longer user sessions and more complex page interactions.

Sites with longer session lengths tend to benefit more from prefetching because there's more opportunity for the predictive loading to pay off. Conversely, sites where users typically visit one or two pages and leave may see less benefit. Average page weight also matters--heavier pages benefit more from having work done in advance, while very lightweight pages may already load too quickly for prefetching to make a meaningful difference.

Iterating on Configuration

Instant.Page offers configurable intensity settings that control when prefetching occurs. Beyond the default hover-based triggering, you can enable prefetching for all visible links in the viewport. If your initial test shows promising but not definitive results, experiment with these settings and run new A/B tests to compare.

Each configuration change deserves its own test. Document your tests and results so you can build a picture of what works best for your specific site and audience. This iterative approach leads to gradual optimization rather than guesswork.

Avoiding Common Pitfalls

Be aware of potential downsides that testing might reveal. Prefetching increases server load because you're loading pages that users might not actually visit. On high-traffic sites, this can translate to meaningful cost increases or performance degradation if not accounted for. Mobile users on limited data plans may appreciate faster loading but could be frustrated by the data usage.

Test on varied network conditions and device types. What looks great on a fast connection with a modern device might behave differently on a congested mobile network with an older smartphone. Your 95th percentile metrics will help you understand how the feature performs for these users.

Working with experienced developers who understand these trade-offs helps you implement optimizations that genuinely improve user experience.

Common Questions About Performance A/B Testing

Conclusion

A/B testing performance optimizations like Instant.Page is essential for making data-driven decisions about your website. By combining Netlify's branch-based split testing with SpeedCurve's real-user monitoring, you can measure actual performance impact on your specific site rather than relying on general assumptions or generic benchmarks.

The testing approach outlined here--branch-based deployments, snippet injection for tracking, and custom data filtering in your analytics--provides a repeatable framework you can apply to other performance optimizations as well. Once you have the infrastructure in place, testing new features becomes straightforward.

Remember that every website is different. What works beautifully on one site may provide modest benefits--or even regressions--on another. The only way to know for sure is to test. This methodical approach to optimization leads to better user experiences and more confident technical decisions.

Ready to optimize your website's performance? Our web development team specializes in performance optimization, A/B testing strategies, and data-driven technical decisions that improve user experience and business outcomes.


Sources

  1. Tim Kadlec: A/B Testing Instant.Page With Netlify and Speedcurve - Full implementation details and metrics
  2. CSS-Tricks: A/B Testing Instant.Page With Netlify and Speedcurve - Industry commentary and context
  3. Netlify Split Testing Documentation - Branch-based testing setup
  4. SpeedCurve LUX API Documentation - Custom data tracking