Slow loading in static APP

Hi, I have a static APP (it does not access server) , this APP has about 55 pages and they are declared in the file app.module.ts, the APP has 3 different languages, the translation I do it with the ‘ng2-translate’ module, each language has 1800 lines in the .json file (around 5400 lines in the 3 languages), and the problem is that when I run the APP it loads very slowly (about 20 seconds with the splash). Someone could tell me how to load faster or why the load it’s so slow.

First thing that i suggest is to change you app to Lazy loading pages

Have you tried compile your app with the --prod tag

ionic cordova build android --prod

walkthrough this link.

Ionic loads very quickly - my app takes less than a second and that includes loading 6 json files (total 365k) .

Yes, lazy loading and prod flag will help - but you really need to understand what is going on in the loading process.

You need to look at your code that runs when you start the app and ask the basic questions such as:.

  • How long does it take to load the json files?
  • How long does it take to process the data after loading the json files?
  • Are there images on the home page? - If so what size are the files and could they be smaller?
  • Is data displayed on the home screen - and if so could you process just the data shown rather than the whole set of data?

Try starting a new blank app and recreate your home page (without any data processing) and see how long that takes to load.

Basically I am saying identify where the bottle necks are - and then do something about it. For example in my app I only load the json files after the home page is displayed.


Finally I was testing the different options and the best one was the flag --prod, now it does not take more than 1 to 2 seconds, thank you very much for the help,