Is it necessary to preload data from the server in order to have immediate access when needed? The data is stored in a file named "data.json".
Initially, I considered storing data.json
in an object and referencing it whenever required.
However, given that there may be a delay before the data is actually needed based on user actions, concerns about memory management arise due to the large size of the object (~5 mb).
My query is regarding whether the browser caches the data.json
file internally during the website session when retrieved via ajax.
In other words, if the file is requested via ajax a second time, will the browser fetch it instantly from its internal memory rather than going back to the server?
If this is the case, it might be redundant to save an additional copy of the file in JavaScript. However, there appears to be lack of information or standards available online regarding this topic.
In short, should I store the downloaded file in an object or rely on browsers to handle caching internally?