Is there a limit on the amount of data I can store inside a javascript variable? If yes:
Is it limited to javascript or browser? (is it a fixed number or a variable number?)
What to do if the limit is reached or exceeded? Browser crashing, or javascript giving error message?
If I make many ajax calls, on different pages, and I want to save the result of these ajax calls in a global variable in javascript for future use (to free up the number of server requests and speed up the response that the user will receive), 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 the amount of data I can store in the cache object? If so, can I somehow check if the data that will be stored is stored, and if not, free the cache? (e.g. using try / catch)
EDIT: a possible duplicate does not answer my question, because I want to know the javascript object limit, not the string, and also does not answer what happens when the limit is reached.
There should be a limit, but it would be nice to know if this limit comes from javascript or the browser, and if I can somehow check if this limit is reached to solve the problem accordingly.
javascript
Adam baranyai
source share