3 ms·
This approach prevents any of those resources from being cached and reused on other pages. Visitors will end up re-downloading all that content if they click on
by josephg 5y ago
This approach prevents any of those resources from being cached and reused on other pages. Visitors will end up re-downloading all that content if they click on any links on your page.
Mind you, most web developers assume users spend a lot more time on their site than they actually do. Most visitors to your website will not click on any internal links on your page.
- chrismorgan 5y agoDeliberate inlining tends to make you more sensitive to size issues so that that’s also less likely to be an issue. Inlining everything also makes it so that you can at least theoretically do more effective dead code removal on CSS and JavaScript, page-by-page, though I’m not sure if I’ve ever seen that actually being done, though the tools mostly exist; but compared with things like GCC and LLVM, web tooling is atrocious at optimisations.
- nicbou 5y agoIt's still worth it depending on the page size and average page views per visit. However we're talking about a very small, very fast website. The parse+request time is longer than the 1-6kb of inlined resources.
- akrymski 5y agoThis approach works best for SPAs / web apps, but is there a reason not to use HTML5 History API these days?