3 ms·
Having "stateless" HTML - meaning the base HTML document is the same for all visitors, across hours of time - can have significant advantages for performance an
by strommen 12y ago
Having "stateless" HTML - meaning the base HTML document is the same for all visitors, across hours of time - can have significant advantages for performance and scalability. Your HTML is now cacheable, and you can host it on a dynamic CDN like Cloudflare, and your TTFB can be really fast. And it will also remain fast if your site gets hugged to death by a spike in traffic.
The downside of course is that rendering different HTML based on your user, their location, cookies, user-agent, etc. is really freakin' convenient. And if you commit to static HTML, you have to do all of your customization on the client, and load real-time data with an AJAX call.
But if you want a highly-performant site, the tradeoff is worth it.