Non SPA Navigation Feature
Overview
The non-SPA Navigation feature allows you to disable the default Single Page Application (SPA) behavior and force the app to use traditional server navigation instead. When spa is set to false, all navigation actions will trigger full-page reloads instead of client-side routing. This feature is available only on leanDom
Why was this feature created? This feature was specifically requested by customers for advertising-related requirements. Some advertising networks and tracking systems work better with traditional page refreshes, as they can properly track page views, refresh ad content, and handle ad impressions more reliably when each navigation triggers a full-page reload.
What is the Behavior?
Default SPA Behavior (Disabled):
- Clicking links or navigating within the app loads new content without refreshing the page
- Faster navigation experience
- Page state is preserved during navigation
No SPA Behavior (Enabled):
- Clicking links or navigating triggers a full-page reload
- Each navigation request goes to the server
- Similar to traditional websites where every click refreshes the entire page
- Page state is reset with each navigation
- Slower navigation but can be useful for debugging or specific requirements
When to Use This Feature
Primary Use Case:
- Advertising Requirements: When customers need better ad tracking, impression counting, or ad refresh functionality that requires full-page reloads
Additional Use Cases:
- Debugging: When you need to isolate issues related to client-side routing
- Testing: To test how the app behaves with traditional server-side navigation
- Legacy Support: When certain functionality requires full-page reloads
How to Disable SPA
To enable this feature, you need to modify the experience-config.json file:
Configuration Example
{
"purple": {
"leanDom": true,
"features": {
"spa": false
}
}
}Configuration Options
Property | Type | Default | Description |
|---|---|---|---|
spa | boolean | true | When false, forces all navigation to use non SPA instead of SPA routing |
What to Expect When Testing
✅ Expected Behavior When Enabled
- Full-Page Reloads: Every navigation action causes a complete page refresh
- Network Requests: Each navigation generates a new HTTP request to the server
- Loading States: You'll see browser loading indicators on each navigation
- URL Changes: URLs still change correctly, but with full page reloads
- State Reset: Application state is completely reset with each navigation
- Ad Refresh: Advertisements will reload and refresh with each page navigation
- Better Ad Tracking: Ad networks can properly count page views and impressions
⚠️ Things to Watch For
- Performance: Navigation will be slower compared to SPA behavior
- User Experience: Users may notice the page "flashing" or reloading
- Form Data: Any unsaved form data will be lost during navigation
Troubleshooting
Still Using SPA Navigation?
- The feature includes fallback logic - if no SPA navigation fails, it will fall back to SPA navigation
- Check browser console for any error messages
- Verify the experience-config.json file is being loaded correctly
Disabling the Feature
To return to default SPA behavior:
{
"purple": {ssssss
"features": {
"spa": true
}
}
}Or simply remove the spa property entirely from your configuration.