To connect JSON on the page or making AJAX requests?

Is content mobile app - the usual SPA, wrapped Phonegap'ohms. Inside is a large JSON file with static data. How best to get the data from it?

1. To rewrite a JSON file as follows:
var data = {JSON...};
and connect it as. JS file . Continue to work as with a normal JS object.

2. Every time you make an AJAX request to the JSON file and work with the answer.
July 9th 19 at 13:54
1 answer
July 9th 19 at 13:56
One
Why? After all, if the JSON file is large, it will occupy a lot of space in RAM? - jamil_Flatley commented on July 9th 19 at 13:59
: Gigabytes? Once loaded in memory and work. Not a thousand times request to send. - Kameron_Hilpert34 commented on July 9th 19 at 14:02

Find more questions by tags AJAXJavaScriptJSON