What can I do to make my Vuejs application load faster?

1

1

I have a pretty simple Vuejs application that is hosted under NGINX. My hardware is Raspberry Pi 3B+ (OS: Raspbian).

Every time I go to my application from any device in my network (Windows computer, Android, IOS), the initial load time is extremely long. If I would have started a stopwatch when I made the initial browser request (from Chrome in all cases), and stopped it when the application had finished loading, I would reach approximately 7 s.

My Vuejs application has a chunk-vendors.js.map-file (~5.4 MB) which seems to be the "heaviest" thing here (according to performance tab in Chrome), I'm not sure.

But! If I for example request the application from my Windows computer, wait a few seconds, and then request the application from my Android device (or the opposite: start with a request from Android device, wait a few seconds, and then request the application from my computer), the loading time for last device is very short!

Question:

All of this makes me believe that something is in idle state? Does NGINX ever go into sleep mode (or something like it)?

Hauns TM

Posted 2019-05-22T05:44:32.173

Reputation: 259

What kind of persistent storage is your raspbian running from? – Seth – 2019-05-22T08:05:11.263

It is a 32 GB SanDisk SD card. Free space, approx 70 %. – Hauns TM – 2019-05-22T08:47:30.790

What's the class of the card? Maybe the loading speed is just slow and your example would indicate the file is being kept in RAM so successive requests are fast until it's unloaded. – Seth – 2019-05-22T09:22:54.037

It's a Sandisk Ultra Micro-SD-card 32 GB. From what I understand the class is Application Performance Class A1. Is it really possible that this could affect my application that much?

It's by no means a complicated application with heavy disc I/O? – Hauns TM – 2019-05-22T11:10:03.200

1

Depending on file organization, health of the card and reader and so on it might have an impact. The A1 defines IOPS but not the actual class of a card. If you deem 7s a long time, taking half a second/a second to load a file from disk would be a long time. It's unkown what other files your site is loading or what it might be doing in terms of computation. If you do have faster access on successive hits caching and what kind of caching is happening would be something to look into. The initial delay might be because resources need to be loaded.

– Seth – 2019-05-22T12:19:20.110

No answers