I am particularly new to the concept of Single-Page Applications (SPA) and I have concerns on what issues may arise from writing such pages meant to be kept open in a browser over a abnormally long period, on the order of a few months.

I understand that there are a few types of SPAs, in particular stateful and stateless SPAs, and am looking to write one that is stateless. I am not looking to make use of SPA frameworks, and stick to jQuery (or is that a bad option?)

The intention is for it to constantly call an AJAX request every few seconds, and refresh certain parts of the DOM according to the response. In addition, other actions may be done on the user's end, also via AJAX and getting a response on successful/failed execution.


My question is, what issues (memory in particular) may arise from keeping a page open that is actively refreshing the DOM, over a really long period? Will I face a memory leak of some sort, and what do I have to keep in mind while writing my application, (like unbinding unused event listeners)?

I would also like to know if it would be a better option to request the user to refresh the page perhaps every day at a convenient time, to "clear" the memory, or would that be unnecessary, because of the browser's in-built garbage collection?

Pardon if this question is off-topic or if there are resources out there which address this issue, as I am new to this.

0

There are 0 answers