Is there a limit on the ammount of data I can store inside a javascript variable? If yes:
Is it limited by javascript, or by browser? (is it a fixed number, or a variable number?)
What if the limit is reached, or exceeded? Does the browser crash, or javascript throws an error?
If I am making a lot of ajax calls, to different pages, and I want to store the result of these ajax calls in a global variable in javascript for future use(to free up the amount of queries to the server, and quicken the response the user gets), is it guaranteed that my data will be stored in this variable?
For example:
function afterAjaxResponse(responseText) {
cache[ajaxIdentifier]=responseText;
}
Is there a limit on how many data I can store in the "cache" object? If yes, can I check somehow if the data to be stored still fits in it, and if not, free up the cache? (for example with a try/catch)
EDIT: The possible duplicate doesn't answer my question, because I want to know the limit of a javascript object, not a string, and it also doesn't answer to what happens when the limit is reached.
There must be a limit, but it would be nice to know, if that limit comes from javascript or the browser, and if I can check somehow if that limit is reached, to solve the problem accordingly.