ODAC.JS Zero-Config Early Hints
Waiting for the server to think is the silent killer of modern user experience. You have spent weeks optimizing your database indexes and shaving milliseconds off your controller logic, yet your users are still staring at a white screen for half a second. The browser is idle, waiting for the first byte of HTML to arrive before it even knows which CSS or JavaScript files to fetch.
At ODAC.JS, we believe that your framework should be smarter than that. We are proud to introduce Zero-Config Early Hints: a high-performance implementation of the HTTP 103 status code that requires absolutely no setup from your side.
The Waterfall Problem
In a traditional request-response cycle, the browser sends a request and then does nothing until the server sends back the full HTML response. Only then can the browser parse the <head> section and start downloading the assets required to render the page. This waterfall effect means your server-side processing time is added directly to your resource download time.
ODAC.JS breaks this cycle. By utilizing HTTP 103 Early Hints, we tell the browser exactly which critical resources it will need before we even start the heavy lifting on the server.
Show Me The Code
The beauty of the ODAC.JS implementation is that there is often no code to show. If you have a standard skeleton file, ODAC.JS already knows what to do.
<!-- skeleton/main.html -->
<html>
<head>
<!-- ODAC.JS detects these automatically -->
<link rel="stylesheet" href="/css/main.css">
<script src="/js/app.js"></script>
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
</head>
<body>
<!-- View part placeholder -->
</body>
</html>
When a request hits your route, ODAC.JS scans your views and skeletons at startup to build an intelligent manifest. The moment a controller identifies which view it wants to render, the framework dispatches the 103 Early Hints.
How It Works Under the Hood
We did not want to add another layer of configuration for developers to maintain. Instead, ODAC.JS uses an automated manifest system that tracks your critical assets:
- Scanning: During boot, the framework crawls your
view/andskeleton/directories. - Detection: It identifies CSS files, blocking JavaScript, and web fonts.
- Dispatch: On every request, it sends the
103 Early Hintsstatus with theLinkheaders immediately. - Parallelism: While your browser is preloading the CSS and fonts, your Node.js process is executing your database queries and business logic.
This architecture ensures that by the time your server sends the 200 OK with the HTML body, the browser has already warmed its cache with the necessary styles and scripts.
Fine-Tuning Your Performance
While the default behavior is designed to be perfect for 99% of applications, we have provided an elegant configuration object in odac.json for those who demand total control.
{
"earlyHints": {
"enabled": true,
"auto": true,
"maxResources": 5
}
}
You can limit the number of resources sent to avoid overwhelming the browser, or disable the feature globally if your infrastructure sits behind a legacy proxy that does not yet support HTTP 103.
Explicit Exclusion
Sometimes you have scripts that are not critical for the initial paint, such as analytics or third-party widgets. ODAC.JS respects the defer attribute. If you mark a resource as deferred, it will be excluded from the Early Hints manifest, preserving bandwidth for what truly matters.
<head>
<!-- This is preloaded via Early Hints -->
<link rel="stylesheet" href="/css/app.css">
<!-- This is ignored by Early Hints but loaded normally -->
<script src="/js/analytics.js" defer></script>
</head>
The Enterprise Advantage
Performance is not just a luxury; it is a core requirement for enterprise-grade applications. By eliminating the idle time between request and response, ODAC.JS provides a snappier, more fluid experience that rivals complex Single Page Applications while maintaining the simplicity of a server-side rendered framework.
Stop making your users wait for your server to finish thinking. With ODAC.JS, the browser starts working the millisecond the request is received.