Smart Preloader is part of the Bunny Optimizer suite and
requires a DNS-accelerated Pull Zone.
How it works
- A user requests a page from your site
- Bunny forwards the request to your origin immediately
- If your origin responds within the trigger delay, the response is returned normally (no preloader shown)
- If your origin exceeds the trigger delay, Bunny returns the preloader screen while keeping the original request alive
- The preloader automatically reconnects to the original request and displays your content when ready
Trigger conditions
The Smart Preloader only activates when all of these conditions are met:Request type
Request type
The request must be for dynamic HTML content. Static assets (images, CSS,
JS) don’t trigger the preloader.
Trigger delay exceeded
Trigger delay exceeded
Your origin must take longer than the configured trigger delay to respond.
Browser request
Browser request
The request must come from a browser expecting an HTML response.
Configuration
Trigger delay
Set the time threshold for when the preloader should appear. If your site typically responds in 700ms, set the trigger delay to 700ms—users only see the preloader when something is slower than usual.Custom HTML
You can replace the default preloader with your own HTML. Include the{{preloader_script}} tag in your HTML body to ensure the reconnection script is injected:
Technical details
Status code
The preloader returns HTTP status
529 to signal browsers not to cache the
temporary response.Cookies
Bunny may set cookies on preloader responses to reconnect users to their
original request. These are never used for tracking.
Error handling
If your origin doesn’t respond at all, users receive a standard
502 or
504 error—not the preloader indefinitely.Feature compatibility
Works alongside Perma-Cache, SafeHop, and Origin Shield with no conflicts.
Performance impact
Smart Preloader is designed to add minimal overhead:- When origin responds in time: Zero overhead (preloader never shown)
- When origin is slow: ~150ms additional load time in worst-case scenarios, primarily from the reconnection script
With Bunny’s average global edge latency under 26ms, the reconnection process
is nearly instantaneous for most users.