---
title: "Comment by Jason Knight on \"Making subsequent page loads faster 🚀 at Hashnode\" | Hashnode"
description: "Honestly, hoodoo throwing more code at it isn&#39;t the answer, but I guess when you&#39;re pretty much strictly CSR telling users with accessibility needs -- a"
url: "https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f"
---

[Discussion](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a)

Comment [Making subsequent page loads faster 🚀 at Hashnode](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a)

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 18, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f)

Honestly, hoodoo throwing more code at it isn't the answer, but I guess when you're pretty much strictly CSR telling users with accessibility needs -- and therefor search engines -- to get stuffed, that's to be expected.

You want to make pageloads faster?

Move the SVG logo's and icons out of the markup so it can be cached and your server-side code doesn't have to waste time pasting them into the markup every time there's a page load. If you're worried about handshake counts since most of them are monochromatic, put them into a font.

Lose the Aria role nonsense that you wouldn't need if you had semantic markup; if that's too much to ask, maybe kill off all the empty ones bloating out the code or ones that have zero business in the markup - like the ones on the HTML tag?

Kill off 90%+ of the data- attributes for react that have no legitimate reason or purpose to exist in the markup other than to make the page slower. If react needs to hook your META tags, there's something horrifyingly **wrong** with how you're building the site. _Though that's just react and why I rail against its use._

Lose the redundant opengraph values that serve zero legitimate purpose when they'll fall-back on your non-og equivalent. _(99% of the time there's no real reason to use anything more than og:image)_

Stop wasting bandwidth on presentational classes. Say what things **are** not what you want them to look like. If you're using classes like "left-items flex-grow-1 d-flex flex-row align-items-center" you're doing it all wrong. As I often say if you want HTML to work that way, you must really miss HTML 3.2.

If you have HTML elements that only serve a purpose for client side scripting, they have no business in your HTML in the first place. Generate all of them from the scripting -- where they can be **cached** instead of on each and every pageload.

There's a reason where you have this 7k of minified code:

```
<div class="progressbar" id="hn-progressbar"></div><div id="__next"><div class="main-wrapper d-flex flex-row" data-reactroot=""><header class="global-sidebar" id="global-sidebar"><div class="d-flex flex-column justify-content-between global-sidebar-content"><div class="sidebar-top"><div class="logo-section"><a href="/"><svg viewBox="0 0 1261 213"><defs><linearGradient id="ma" x1="0%" y1="0%" y2="100%"><stop offset="0%" stop-color="#2196F3"></stop><stop offset="100%" stop-color="#2962FF"></stop></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="url(#ma)" d="M44.080002 0h124.839996C193.264711 0 213 19.735289 213 44.080002v124.839996C213 193.264711 193.264711 213 168.919998 213H44.080002C19.735289 213 0 193.264711 0 168.919998V44.080002C0 19.735289 19.735289 0 44.080002 0zm112.614012 186.48571l-.032768-.006554c11.317072-.187479 20.52155-9.173403 20.980882-20.482704.459331-11.309301-7.986098-21.012082-19.25069-22.116725l-40.764377-71.973375c-5.963921-10.70884-17.478874-10.243524-21.627403 4.954642-3.565245 14.392053-2.647718 27.951779-3.683212 44.336175-.006749.107669-.082052.19875-.186533.225617-.104481.026866-.21438-.016592-.27223-.107649l-36.39302-72.550105c2.970206-2.332552 4.70883-5.896732 4.718705-9.673348C60.183368 32.413631 54.769737 27 48.091684 27 41.413631 27 36 32.413631 36 39.091684c0 6.678053 5.413631 12.091684 12.091684 12.091684.570177 0 1.035494-.117967 1.494257-.117967C64.902074 90.446935 81.9484 136.395335 88.04995 146.992762c4.14853 10.132111 18.311201 6.907661 18.65855-4.030561l1.494257-57.463354c0-.347349.458763-.347349.576731-.117967l29.229762 69.548484c-1.738487 3.135306-2.641246 6.665096-2.621503 10.250078.014444 11.761139 9.545129 21.291824 21.306268 21.306268z"></path><path fill="#46494C" d="M283 40.4h26.8v59.8h69.8V40.4h26.8v140h-26.8v-56.8h-69.8v56.8H283v-140zm217.385186 140v-13c-3.733352 4.66669-8.533304 8.199988-14.4 10.6-5.866696 2.400012-12.599962 3.6-20.2 3.6-7.466704 0-14.033305-1.433319-19.7-4.3-5.666695-2.866681-10.033318-6.833308-13.1-11.9-3.066682-5.066692-4.6-10.733302-4.6-17 0-10.00005 3.533298-17.833305 10.6-23.5 7.066702-5.666695 17.066602-8.566666 30-8.7h31.2v-2.8c0-6.266698-2.066646-11.133316-6.2-14.6-4.133354-3.466684-10.133294-5.2-18-5.2-10.133384 0-20.733278 3.3333-31.8 10l-9.4-18c8.400042-4.66669 16.033299-8.033323 22.9-10.1 6.866701-2.066677 14.899954-3.1 24.1-3.1 13.866736 0 24.633295 3.3333 32.3 10 7.666705 6.6667 11.566666 15.99994 11.7 28l.2 70h-25.6zm-28.4-18.8c7.466704 0 13.86664-1.766649 19.2-5.3 5.33336-3.533351 8.33333-7.899974 9-13.1v-9.6h-27c-6.933368 0-12.033317 1.033323-15.3 3.1-3.266683 2.066677-4.9 5.43331-4.9 10.1 0 4.533356 1.699983 8.13332 5.1 10.8 3.400017 2.66668 8.033304 4 13.9 4zm143.785185-59.2c-5.200026-3.066682-10.566639-5.466658-16.1-7.2-5.533361-1.733342-10.63331-2.6-15.3-2.6-4.400022 0-7.899987.766659-10.5 2.3-2.600013 1.533341-3.9 3.899984-3.9 7.1 0 3.33335 1.633317 5.899991 4.9 7.7 3.266683 1.800009 8.433298 3.69999 15.5 5.7 7.466704 2.266678 13.599976 4.499989 18.4 6.7 4.800024 2.200011 8.966649 5.466645 12.5 9.8 3.533351 4.333355 5.3 10.033298 5.3 17.1 0 10.400052-3.99996 18.399972-12 24-8.00004 5.600028-18.066606 8.4-30.2 8.4-8.266708 0-16.333294-1.299987-24.2-3.9-7.866706-2.600013-14.533306-6.299976-20-11.1l9-18.2c4.800024 4.133354 10.5333 7.366655 17.2 9.7 6.6667 2.333345 12.99997 3.5 19 3.5 4.800024 0 8.633319-.833325 11.5-2.5 2.866681-1.666675 4.3-4.16665 4.3-7.5 0-3.733352-1.66665-6.533324-5-8.4-3.33335-1.866676-8.733296-3.933322-16.2-6.2-7.200036-2.133344-13.066644-4.233323-17.6-6.3-4.533356-2.066677-8.46665-5.199979-11.8-9.4-3.33335-4.200021-5-9.699966-5-16.5 0-10.533386 3.833295-18.566639 11.5-24.1 7.666705-5.533361 17.299942-8.3 28.9-8.3 7.066702 0 14.033299.99999 20.9 3 6.866701 2.00001 12.96664 4.799982 18.3 8.4l-9.4 18.8zm95.785186-30c12.266728 0 21.933298 3.699963 29 11.1 7.066702 7.400037 10.6 17.43327 10.6 30.1v66.8h-26.2v-59.2c0-7.466704-2.133312-13.366645-6.4-17.7-4.266688-4.333355-10.06663-6.5-17.4-6.5-8.66671.133334-15.533308 3.066638-20.6 8.8-5.066692 5.733362-7.6 13.066622-7.6 22v52.6h-26V32h26v61.8c7.33337-14.00007 20.199908-21.133332 38.6-21.4zm130.385186 0c12.266728 0 21.933298 3.699963 29 11.1 7.066702 7.400037 10.6 17.43327 10.6 30.1v66.8h-26.2v-59.2c0-7.466704-2.133312-13.366645-6.4-17.7-4.266688-4.333355-10.06663-6.5-17.4-6.5-8.66671.133334-15.499975 3.066638-20.5 8.8-5.000025 5.733362-7.5 13.066622-7.5 22v52.6h-26v-107h26v20c7.33337-13.733402 20.133242-20.733332 38.4-21zm112.785185.2c11.066722 0 20.833291 2.266644 29.3 6.8 8.466709 4.533356 15.066643 10.899959 19.800002 19.1 4.73336 8.200041 7.1 17.63328 7.1 28.3 0 10.800054-2.36664 20.333292-7.1 28.6-4.733359 8.266708-11.333293 14.666644-19.800002 19.2-8.466709 4.533356-18.233278 6.8-29.3 6.8-11.200056 0-21.066624-2.266644-29.6-6.8-8.533376-4.533356-15.166643-10.933292-19.9-19.2-4.733357-8.266708-7.1-17.799946-7.1-28.6 0-10.66672 2.366643-20.099959 7.1-28.3 4.733357-8.200041 11.366624-14.566644 19.9-19.1 8.533376-4.533356 18.399944-6.8 29.6-6.8zm0 22.2c-9.066712 0-16.399972 2.99997-22 9-5.600028 6.00003-8.4 13.799952-8.4 23.4s2.799972 17.39997 8.4 23.4c5.600028 6.00003 12.933288 9 22 9 8.800044 0 15.999972-2.99997 21.6-9 5.600028-6.00003 8.4-13.799952 8.4-23.4s-2.799972-17.39997-8.4-23.4c-5.600028-6.00003-12.799956-9-21.6-9zM1133.91111 32v148.4h-26v-17.2c-3.86668 6.00003-8.8333 10.566651-14.9 13.7-6.06669 3.133349-13.09996 4.7-21.1 4.7-10.13338 0-19.03329-2.299977-26.7-6.9-7.6667-4.600023-13.63331-11.066625-17.9-19.4-4.26668-8.333375-6.4-17.899946-6.4-28.7 0-10.66672 2.09998-20.099959 6.3-28.3 4.20003-8.200041 10.1333-14.566644 17.8-19.1 7.66671-4.533356 16.43329-6.8 26.3-6.8 8.13338 0 15.26664 1.599984 21.4 4.8 6.13337 3.200016 11.19998 7.79997 15.2 13.8V32h26zm-56.4 127.8c8.93338 0 16.23331-3.033303 21.9-9.1 5.6667-6.066697 8.5-13.899952 8.5-23.5s-2.8333-17.433303-8.5-23.5c-5.66669-6.066697-12.96662-9.1-21.9-9.1-8.93337 0-16.19997 3.033303-21.8 9.1-5.60002 6.066697-8.46666 13.899952-8.6 23.5.13334 9.600048 2.99998 17.433303 8.6 23.5 5.60003 6.066697 12.86663 9.1 21.8 9.1zm131.58519-87.2c17.06675 0 29.89996 4.866618 38.5 14.6 8.60004 9.733382 12.9 23.399912 12.9 41 0 3.466684-.06667 6.066658-.2 7.8h-79c1.73334 7.600038 5.29997 13.566645 10.7 17.9 5.40003 4.333355 12.03329 6.5 19.9 6.5 5.46669 0 10.69997-1.033323 15.7-3.1 5.00002-2.066677 9.36665-5.033314 13.1-8.9l14 14.6c-5.33336 5.866696-11.8333 10.399984-19.5 13.6-7.66671 3.200016-16.16662 4.8-25.5 4.8-10.93339 0-20.56663-2.266644-28.9-6.8-8.33338-4.533356-14.76664-10.899959-19.3-19.1s-6.8-17.63328-6.8-28.3c0-10.66672 2.29998-20.133292 6.9-28.4 4.60002-8.266708 11.03329-14.699977 19.3-19.3 8.26671-4.600023 17.66661-6.9 28.2-6.9zm27.6 46c-.26667-7.866706-2.86664-14.13331-7.8-18.8-4.93336-4.66669-11.46663-7-19.6-7-7.60004 0-13.96664 2.299977-19.1 6.9-5.13336 4.600023-8.29999 10.89996-9.5 18.9h56z"></path></g></svg></a></div><nav class="primary"><ul class="list-unstyled"><li><a href="/" class=""><span>Home</span></a></li><li class="dropright"><a href="#" class="d-flex flex-row justify-content-between align-items-center" data-toggle="dropdown"><span>Posts</span><i class="mdi mdi-chevron-right"></i></a><div class="dropdown-menu"><a href="/discussions" class=""><span>Discussions</span></a><a href="/stories" class=""><span>Stories</span></a><a href="/news" class=""><span>News</span></a></div></li><li><a href="/tags" class=""><span>Tags</span></a></li><li><a href="/amas" class=""><span>AMAs</span></a></li><li><a href="/jobs" class=""><span>Jobs</span></a></li></ul></nav></div></div></header>
```

Anyone who actually knows how to use HTML would use this:

```
<div id="top">
    <h1><a href="/">Hashnode</a></h1>
    <ul id="mainMenu">
        <li><a href="/">Home</a></li>
        <li>
            <input type="checkbox" id="mainMenu_postsToggle">
            <label for="mainMenu_postsToggle">Posts</label>
            <ul>
                <li><a href="/discussions">Discussions</a></li>
                <li><a href="/stories">Stories</a></li>
                <li><a href="/news">News</a></li>
            </ul>
        </li>
        <li><a href="/tags">Tags</a></li>
        <li><a href="/amas">AMAs</a></li>
        <li><a href="/jobs">Jobs</a></li>
    </ul>
<!-- #top --></div>
```

Assuming one is ok with abusing a checkbox with :checked for the submenu show/hide. Be even less markup if you wanted to rely on a JS only solution.

That's 1/15th the code that would have to be sent on subsequent pageloads. There's a reason when I say people using things like react, bootstrap, and other such crutches are making themselves work harder, not smarter -- because you're making massive convoluted non-semantic inaccessible messes of it with anywhere from two to twenty times the code needed to do the job! That's why it's slow.

As evidenced by the home page of this site right this moment for a non-logged in guest, takes 3 megabytes in 33 separate files just for the HTML, CSS, JavaScript, and XHR present, all to deliver 2.03k of plaintext, maybe two dozen links, and not even a half dozen content media elements -- not even 10k of HTML's job. Much less given the relative simplicity of this site's design it being highly unlikely for the **entire site** to need more than 48k of CSS in one or two files. Add on the endless horde of JavaScript with no scripting off graceful degradation...

Literally, 90k of HTML doing 10k's job. Nearly a megabyte of CSS in six files doing 48k or less in one or two files' job. Almost two megabytes of JavaScript in two dozen files doing stuff that the lions share of which shouldn't even be having scripting thrown at it!

In handshakes alone the realtime overhead for the majority of the world who doesn't have "magic perfect ultra-fiber broadband" comes to anywhere from 5 to 25 seconds just for the code. That's first-load, but the checks and/or sheer volume of it blowing out many browsers cache limits _(the reason all that playing with cache-control headers placebo BS doesn't actually work for people who visit more than two websites a day no matter what Google says)_ still means "hey has this been updated" requests are gonna hurt.

So not only would such optimization of the code by kicking bootstrap to the curb and reigning in (if not just killing off) react result in faster subsequent visits, it would also speed up initial pageloads.

Of course, you're knee deep in it, so simply getting a stick to -- as I often joke -- "scrape off the bootcrap" is gonna hurt, since we're basically talking a complete rewrite to deal with bad choices in frameworks. But then you know me, IMHO there is no such thing as a good front-end framework for web development. They make you write two to five times the code needed, deploy five to twenty times the code needed, spread stuff out over dozens of separate files when there's no reason to have more than 3 to 5 of them _(not counting social plugins, but even those can be bamboozled into behaving)_.

Throwing some fancy "service" and more code at it isn't the answer. Thanks to the choices of technologies you've got a 5+ megabyte homepage spanning 80+ files before lazy-loading even kicks in -- where more than half of that could be pitched in the can -- and you're worried about screwing around with wasting bandwidth on precaching after the fact, playing games figuring out what the user's connection speed is, and figuring out what links are in the viewport?

Sorry, but like a lot of things Google is doing lately, waste of time, waste of bandwidth, waste of code to correct for poor architectural choices.

Again, exactly the type of failings I go into banks, healthcare, public utilities, and government agencies to send to the nether realms like the reaper leading the horsemen of the apocalypse.

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 18, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c18846af160790a122d2c43)

Oh, also for what reason does this site do full on pageloads of subpages, when the content is CSR only? How does that even make sense?

Am I missing some strange detail of your implementation, because it **does** seem to do a full page-load, but scripting off there's no content. That's highly inconsistent with why you'd even have CSR only content. Just node flush the existing content, load the new content, update window.title and do a history.push. If you're gonna do it, do it scripting only for content, do it in a manner that skips the pageload of all the extra bits that are the same on every page.

Oh wait, it looks like you almost have that mechanism -- so my bad. I just middle-click too much.

\-- edit -- I actually have to congratulate you on that last bit, so many sites that load content the way you are end up utterly broken and useless when you try to open links via middle clicking/ctrl-click into a new tab. It's an attention to detail I'm not used to seeing with the technologies you're using.

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 18, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c194bbf3960ebb0612df539)

More observations -- I had a spare moment and took a look at the waterfall -- you do know that typekit is blocked by just about every JS safety out there, right? ABP, Ghostery, ScriptSafe, it's even blacklisted by anti-anti-adblock's anti-mining list because even though it's from Adobe it isn't considered trustworthy? It's bad enough that on a page using CSR for navigating from a sub-page to the home-page for... well... this:

![bloat, bloat, bloat](http://www.cutcodedown.com/for_others/hashnode/images/requests_CSR.png)

I'm lucky I'm on fiber, most people I know aren't.

That two dozen of those file requests are blocked and are all for the typekit scripting junk? 56 images on a page that (before lazy loading on infinite scroll) doesn't even have a third that in content images; **none of which seem to be caching** even though I was just on that page? _(I suspect a cache miss due to poor cloudfront management)_, 22 separate XHR requests when at most it should be doing three, and best case should only need one? _(ah, JWT, how we loathe thee when it comes to the impact on load time)_

Then this little detail certainly isn't helping:

![duplicate requests of the same basic images](http://www.cutcodedown.com/for_others/hashnode/images/duplicateRequestsFromDifferentSources.png)

Many of the image requests are of the same basic monochromatic .png with a minimum of variation in size -- do you really need five separate 1k to 2k .png files for a red exclamation point? Handshaking for nothing and around 30 to 40 of those image requests are UI related, meaning they should 1) already be cached, and 2) really shouldn't even need to be IMG files, that's what using webfonts for vectors are for so you can have a single file request in the ~30k range at the start. One 30k file is more likely to remain cached than 60k spread out over 40 files. With the massive scripting bloat browsers are likely flushing the smaller stuff.

I mean, why is it re-requesting and re-downloading in a complete cache-miss the various thumbs-up / beer / clap icons? That's a problem! Much less since you have a fixed number of those why aren't they leveraging CSS sprites?

So... yeah. Maybe instead of trying to use fancy tools you could just fix the markup using separation of presentation from content _(by kicking the framework trash to the curb)_ and leverage file count reductions better?

[Emil Moe](https://hashnode.com/@emilmoe)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1bb1e113e6579f6dfd2491)

Are these emoji images downloaded? They exists on almost any platform as default font as far as I know?

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1bd5ed13e6579f6dfd2689)

[Emil Moe](https://hashnode.com/@emilmoe) They are indeed static images loaded from a CDN... and yeah, whilst they do appear slightly different across platforms, many of them do indeed exist in UTF-8, and on some platforms with the new colour TTF support do so in colour.

Making all those files even sillier, and outdated in methodology. But even as images using the _incorrectly named_ "CSS Sprites" technique could reduce the number of handshakes speeding page-loads.

I'm more concerned about the fact that even when there isn't a page-load and new content is SSR'd in, they don't seem to be caching locally.

[Emil Moe](https://hashnode.com/@emilmoe)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1bdb8113e6579f6dfd27a3)

What would your advice for amount of files loading per request be? And the total size with disabled cache?

I remember back in the days the golden rule was 8 SQL queries, but I think that was with MS Access. However it should be sufficient, otherwise async.

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c16f543eff1884e8566bf)

[Emil Moe](https://hashnode.com/@emilmoe)

It's actually a bit tricky that -- the file counts -- because the rules are different between http, https, and https with Google's... whatever the hell they called it that turns multiple requests into fewer (or even just one) connection. Gah, what was it called? SPDY? Yup. That's it.

[chromium.org/spdy/spdy-whitepaper](https://www.chromium.org/spdy/spdy-whitepaper)

That one throws a monkey wrench in the works to a degree as it does multi-requests across a single connection, but requires both browser and server support you can't rely on existing in all UA's... and the best rule of thumb for speed is to target lowest common denominator, not bleeding edge not everyone has. If anything, the bleeding edge folks don't matter because if you make it good enough for the bottom end, it's just fine and dandy if not stellar for the high end!

That said, I try to limit myself to the 1:2:2:6 model. That's 1 HTML file, 2 CSS files, 2 JS files, and 6 presentational images, presentational media, or font files.. That's not counting content images. Things like the social media buttons, site logo, likes, and so forth are **not** content and as such have no business as IMG, OBJECT, or SVG tags in the HTML.

Content you often just don't have a lot of choice, but that's why you need to keep the template lean so there's room for the content. Kind of like design itself, the best design being one that goes unnoticed as users happily get to the only thing that **really** matters on a page -- **the content!**

But again part of why I say a site -- even one as complex as hashnode -- has no real business wasting more than 48k of CSS for the **entire site**. They're not doing anything to warrant more than that if the starting HTML and the content they CSR in were structured properly. There are very few websites in existence that have any real legitimate reason for more than 48k of CSS in two files (and that's me Mr. Scotting those figures) apart from bad choices in technologies (aka "frameworks") and a general ignorance of how to use HTML and CSS the way they were meant to be used. Same with the Javascript where we see endless "JS for nothing" on sites that would use less bandwidth, load faster, and be easier to maintain if all that garbage were thrown off a cliff into the sea. _Who knows, maybe the blood will churn in the foam and turn into something beautiful -- not._

But really, lowest common denominator is plain HTML. If you're making templates for others you should assume that and work from there. If nothing else it will still work better when things like SPDY kicks in as it's less files for it to juggle across connections. It also plays well when people are on connection-starved plans, such as sitting there at Panera bread or Starbucks leeching the web during lunch.

To that end, the common wisdom of figuring out the impact cache-empty is:

first eight files = 500ms every connection past that is 200ms.

That's the "average to best case" range. Sure, we fortunate few sitting on fiber or less than a mile from the backbone might see as little as 30ms for each -- but la-di-dah for **US**. It's not about "oh it's fast for me" -- it's is it fast for **everyone**.

(What do you mean everyone?)\[[youtube.com/watch](https://www.youtube.com/watch?v=74BzSTQCl_c)\]

Worst case it ends up a second per file. Yes, that happens. So a page with 68 files can end up taking a minute or more cache-empty first-load.

As to cache full when properly caching, that's a big long topic with one simple answer: The only thing that shouldn't be pre-cached after visiting the first page is HTML and any new content media not already loaded, so move as much of the stuff that doesn't need to be in the HTML -- like presentation and behavior -- out of the HTML.

Which is **another** of the many reasons that when frameworks do things like this:

```
    <div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow">
        <h5 class="my-0 mr-md-auto font-weight-normal">Company name</h5>
        <nav class="my-2 my-md-0 mr-md-3">
            <a class="p-2 text-dark" href="#">Features</a>
            <a class="p-2 text-dark" href="#">Enterprise</a>
            <a class="p-2 text-dark" href="#">Support</a>
            <a class="p-2 text-dark" href="#">Pricing</a>
        </nav>
        <a class="btn btn-outline-primary" href="#">Sign up</a>
    </div>
```

It ends up like they need a stern talking to by Robert Downey Jr's character from Tropic Thunder. _Whilst I tend to go R. Lee Ermey on their tuchas'_

All those pointless presentational classes defeat the point HTML and CSS are separate, and reek of HTML 3.2 mentality -- proving the people who make and promote this framework idiocy are utterly unqualified to write a single line of HTML, much less tell others how to do so.

_A claim only further proven by that H5 and lack of block level separations inside the NAV... but tell me again how good Bootstrap is._

Any competent developer would have written this:

```
<body>

    <div id="top">
        <h1>Company name</h1>
        <ul id="mainMenu">
            <li><a href="#">Features</a></li>
            <li><a href="#">Enterprise</a></li>
            <li><a href="#">Support</a><li>
            <li><a href="#">Pricing</a></li>
            <li class="signup"><a href="#">Sign Up</a></li>
        </ul>
    <!-- #top --></div>
```

You shouldn't even need NAV if you bother using H2 _(or even HR)_ properly to start the bloody content!

Creating bloated markup that relies on a massive CSS library for NOTHING whilst also using JavaScript to do CSS' job is not going to make for a fast website. Nor does it make it "easier", "simpler", or "better when working in a group" despite the wild unfounded claims to the contrary.

Speedy sites is easy, **people** make it hard. Keep the total file counts low, avoid using JS for nothing, avoid using JS for things CSS or HTML can do without the scripting, and move anything you possibly can out of the markup where it can be cached across page-loads.

There's a reason my specialty 15 years ago was taking websites so bloated they were choking out the dual Xeon servers of the time with gigs of RAM and hosting them comfortably on P3 era hardware with half a gig. _(about equal to a cheap VPS plan today)_. I bothered paying attention to why CSS existed, accessibility rules and guidelines, and the intent/reasoning behind the creation of HTML 4 Strict.

Whilst the rest of the world seemingly shoved it's head up the 1990's backside and spent a decade slopping out 4 transitional -- literally meaning "in transition from 1997 to 1998 practices"... which is why so much of what people are doing in HTML 5 reeks of HTML 3.2 style browser-wars era **mental**ity. Emphasis on the "mental".

Hence the code bloat messes we see today. When most developers, even alleged "experts" don't even seem to realize what numbered headings are even for, don't expect quality markup as a result.

... and it's how Hashnode likely got duped into thinking that this: _(formatting added for clarity)_

```
<div class="dropdown-menu">
    <p class="dropdown-label">Select one:</p>
    <div class="d-flex flex-row flex-wrap">
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35484">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-1-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35485">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-2-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35486">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-3-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5abf">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-4-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5abd">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-5-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5abc">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-6-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5abb">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-7-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5ab9">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-8-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5ab8">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-9-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35487">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-10-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35488">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-11-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d35489">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-12-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d3548a">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-13-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5aba">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-14-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5ac0">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-15-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="5c090d96c2a9c2a674d3548b">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-16-min.png"/>
        </a>
        <a class="dropdown-item  d-flex align-items-center" href="#" data-reaction-id="567453d0b73d6a82ac8c5abe">
            <img src="d3h1a9qmjahky9.cloudfront.net/app-17-min.png"/>
        </a>
    </div>
</div>
```

Is how a page should be written... where's the ALT attributes? Why all the classes when the perfectly good parent has a class? Why all the separate images? Why the hash links or even anchors when this seems to be scripting only functionality? Where are the block level separators or text to tell users what these even are on image failure/blockage? What makes "select one" a grammatical paragraph?!? All for images I'm not even certain belong in the markup and are prime candidates for CSS sprites and/or font replacement. Worse, being scripting only in functionality they have no business in the static markup in the first place and should be built post-load on the DOM.

... but your average react developer wouldn't even bat an eyelash at that; then they wonder why their sites are slow bloated hard to maintain messes that often land them face to face with fines and court dates in some industries.

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c1c146ea06c503db7d0db)

Just to explain that last snippet, I would probably have this instead as the structure:

```
<div class="likeSection">
    <h3>Select Type of Like</h3>
    <button type="button" class="like"><span>Like</span></button>
    <button type="button" class="love"><span>Love</span></button>
    <button type="button" class="unicorn"><span>Unicorn</span></button>
    <button type="button" class="notWorthy"><span>We're not Worthy</span></button>
    <button type="button" class="applause"><span>Applause</span></button>
    <button type="button" class="beer"><span>Have a Beer</span></button>
    <button type="button" class="cheers"><span>Cheers</span></button>
    <button type="button" class="trophy"><span>Trophy</span></button>
    <button type="button" class="crown"><span>Crown</span></button>
    <button type="button" class="flames"><span>On fire</span></button>
    <button type="button" class="crush"><span>I've got a Crush</span></button>
    <button type="button" class="peace"><span>Peace out</span></button>
    <button type="button" class="cash"><span>Bag o' cash</span></button>
    <button type="button" class="star"><span>You're a Star</span></button>
    <button type="button" class="cool"><span>Cool</span></button>
    <button type="button" class="party"><span>Party on</span></button>
    <button type="button" class="target"><span>Spot on</span></button>
</div>
```

Except generated by the scripting since it's scripting only functionality. It's 1/3rd the code, the images being loaded as CSS sprites or from fonts from the stylesheet. The scripting to generate that not even being a handful of lines even as vanilla.

... and moving that out of the static markup means less markup to send when a pageload triggers since external scripting can be **cached**. Moving the images into the CSS means less markup since the external stylesheet can be **cached**.

Assuming cache-control isn't screwed up and such things are actually being cached.

Also means you could hook them as you generate them instead of slopping all over the markup with that data-react-id trash even further reducing the bloat.

Just part of why I call things like React and Bootcrap incompetent garbage. They take something so simple and make it so pointlessly bloated and aggravatingly difficult to work with.

[Emil Moe](https://hashnode.com/@emilmoe)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c1dcf43eff1884e856759)

When you explain in details your opinion I have to say I strongly agree and I follow you, in opinion and practice, most of the way. I ain't gonna put down Sass or Vue, but my software are specialised and locked applications, so only a few access it and there's just so much ease of work when using something that actually structures your work and I have, forgot what it's called, but the option to make it only load the actual JavaScript pieces a given page needs. Same reason I chose Laravel, but that not in the topic here.

On the other cases with bunch of classes and missing attributes, I completely agree. It looks like those templates from ThemeForest. I have bought a few, and always end up creating my own version as they are so poorly made.

I will give you that Vue adds an overhead of 20kb, again, that's a balance decision to make. I also need to make a living out of it and as long as I can use a public CDN for the Vue, it's most likely 20kb the user won't have to load when they visit my site.

_My apology for the poor grammar, I haven't slept for 24 hours and last night was just 3 hours_

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c22646ea06c503db7d0eb)

[Emil Moe](https://hashnode.com/@emilmoe) Vue is light in terms of itself minified, it's what it does and how it does it that creates unnecessary bloat. Painfully so.

The moment I see something like this:

```
<div id="app-4">
    <ol>
        <li v-for="todo in todos">
            {{ todo.text }}
        </li>
    </ol>
</div>
```

At least in client-side scripting, I'm pretty much "yeah, we're done here". Scripting only elements in the markup. No. **Oh hell no!**

Sure... just **actively** encourage the inaccessible **disaster** that is CSR with no fallbacks. Why not? What could go wrong... If nothing else, if you're gonna CSR only (which is bad) at least do it, and get scripting only code out of the flipping markup where it has **no** business being!

It's why I think webComponents is one of the dumbest things ever, much like HTML 5's stupid "structural tags" or the idiotic "aria role" bull it's a broken stupid methodology I would wave people off from. It reminds me too much of that inaccessible broken "XSL Transforms" trash that turned XHTML into a technological dead-end.

Maybe if I were building a standalone application in something like nw.js or electron, then I could see it... but on something served over the Internet to a normal web browser? _Nancy Reagan that bekaptah nonsense._}

But long term I shouldn't complain, just means more companies for me to go into and bail out when this type of rubbish ends up used in the wrong industries.

_... and yeah, not been sleeping too good myself. I suspect Holiday stress. I've had to fight off the dreadful urge to be merry._

[Emil Moe](https://hashnode.com/@emilmoe)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c240d43eff1884e85675f)

And how would you dynamically render stuff on the website without some sort of content creation through JavaScript? It has to be either this or `document.createElement('li')` then again making it reactive easily becomes a pain if handheld.

I still agree the the simple solutions are the best, but simplicity should be considered from both sides. Developer and user.

To another point earlier, of course CSS would always be in favour of JavaScript. That should be common sense to anyone in this business, that CSS is 99% of the time much faster to render and much more optimised in browsers.

[Jason Knight](https://hashnode.com/@cutcodedown)

[Dec 20, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c289b43eff1884e856762)

[Emil Moe](https://hashnode.com/@emilmoe) I think you missed my meaning.

> And how would you dynamically render stuff on the website without some sort of content creation through JavaScript?

I would do it exactly there, **in the script** - using createElement, createTextNode, textContent, and so forth. A simple 'make' helper to speed up generation being all that's needed.

In that example code for vue I lifted straight from their tutorial, I would not have the DIV, the OL, or the LI in the markup. I would figure out what element is before/after where I want the DIV _(assuming it even needs a DIV, which usually it doesn't, OL's a perfectly good block-level container)_, generate it from the scripting and insertBefore/appendChild it as appropriate.

Then it doesn't even need ID's or bizzaro curly bracket BS to hook it, as you just made the element.

**IF** it's going to be scripting only functionality, it doesn't go in the markup... **Any** of it. Not one line. Because if it's used across multiple pages in the same fashion, you just missed a caching opportunity. Because if someone is visiting with scripting blocked, it's a bit obtuse to have a bunch of non-functional garbage in the markup.

Though again, 99% of what I deal with is built with accessibility first, fancy "dynamic" stuff second... which means a lot of what we're talking about has zero business being implemented client-side, and if there is a client side to it that's an enhancement replicating and improving an already working page, **not** the only means of providing functionality.

Hence why the majority of scripted "apps" are an annoyance that when duped into using them screws over the clients I'm called in to "consult" with. By their very nature such "dynamic" scripting if no scripting off fallback is provided violates accessibility norms.

It's OK to do it, if you know the risks, plan for the risks, and have a fallback plan, and do it in a rational gracefully degrading manner. Otherwise you're just gambling on how long before it whips around and bites you in the backside.

Aka where pretty much **everything** I've ever seen built with these "front end frameworks" fail spectacularly.

[Emil Moe](https://hashnode.com/@emilmoe)

[Dec 21, 2018](https://hashnode.com/posts/making-subsequent-page-loads-faster-at-hashnode/5c17a248290e874261d54d8a/comment/5c1880dfc2dc419a62d24f1f#reply-5c1c8e5a39a770ed41f368a4)

I'm missing your point on how to make it reactive then?

As I have read your opinions right now. It's not an impossible task to create a 'mini JavaScript ''framework''' allowing to add, remove stuff and create it reactive and support for AJAX. Not sure what else the frameworks provides.

Just trying to get your ideas. I still believe some sort of framework is good for faster development, but maybe it can be simplified without too much payoff.
