speculative_loading
This module is part of the DXPR ecosystem and included in DXPR CMS.
Speculative Loading enables browsers to preload pages users are likely to visit next, creating near-instant navigation experiences on your Drupal site. By intelligently prefetching or prerendering pages based on user interactions, this module dramatically improves perceived performance without requiring complex technical setup.
You need Speculative Loading if
- You want to improve your site's perceived performance and navigation speed
- You need near-instant page loading without complex technical setup
Features
- Implements the modern Speculation Rules API to improve website performance
- Supports both prefetch (lightweight) and prerender (full-page) modes
- Configurable eagerness levels (Conservative, Moderate, or Eager) to balance performance and resource usage
- No-code required: works automatically on standard Drupal frontend pages
- "No-prerender" CSS class can be added to exclude specific links
- Hook API allows programmatic exclusion of URL patterns
- Plugin system for extending functionality with custom rules
Post-Installation
After installing the module, it works immediately with default settings. To customize:
1. Navigate to "Configuration" > "Development" > "Performance" > "Speculative Loading"
2. Choose between "Prefetch" or "Prerender" mode (prerendering provides faster experiences but may affect interactive content)
3. Select your preferred eagerness level
4. Save your configuration
No additional setup is required as the module automatically adds the necessary markup to your pages.
Recommended modules/libraries
While not required, the following modules complement Speculative Loading:
- BigPipe: For progressive page rendering
Supporting this Module
This module is maintained by DXPR. If you find it valuable, consider checking out our free page builder (with paid features for large websites):
- https://www.drupal.org/project/dxpr_builder
Community Documentation
- Speculation Rules API on MDN
- Chrome's documentation on prerendering
Browser Support
The Speculation Rules API is supported in modern Chromium-based browsers (Chrome, Edge, Opera). Other browsers will gracefully ignore the functionality with no negative effects.
Wider browser support is underway: Firefox is actively working on implementing the Speculation Rules API. You can track their progress here: Firefox Bug #1969396