91

In my previous company, I used to work for a client company which had a terrible website. It was about financial data and people would have to wait too long before the page loaded because there was a freaking 1.2 megs of minified, compressed JS file that needed to load before you could do anything.

Everyone knew that was a pain in the ass and nobody wanted to touch spaghetti code and mess up something they didn't know.

I wanted to however take a shot at it. So an architect from client side and I discussed how we were gonna go about it and how we were gonna find the stuff that needed to load on page load and stuff that could be loaded later.

So we plan for it. We broke everything down from a globals polluting JS, found out the variables and functions that needed to run during first load by literally putting a console statement for each function and finally came up with two bundles.

The primary bundle was 120kb and would during first load and then every module would call it's own secondary bundle when the user interacted with it.

In the process, we removed half a meg of JS and the site became blazing fast.

I did it with a team of two members who, my manager thought were useless, learned a ton of stuff, setup proper process for the transition.

When the client didn't appreciate the amount of brain and effort we had put into it, these two members came forward to tell the client to acknowledge my effort and attributed the success of it to me.

I was totally moved. There was so much respect that I didnt care what anybody else thought. I was just so happy to work with those two humans.

When i left the company, i gifted them stuff they always talked about or wanted. :) Feels good.

Comments
Add Comment