greetings, a. nonymous

 

 login

6 : 43 AM EDT

[OK]

tooltips updated to make the same request exactly once saving bandwidth and ram

tooltips were working for posts and mantra details except that an AJAX request was made for every url even if it had already been loaded. this wastes bandwidth and RAM and I set about making it more efficient.

today (2015-sep-15) I got some help from some nice people in ##javascript on freenode that helped me save resources when doing tooltips.

the trouble I was having was that the cache was always initialized to empty. I thought at first it was a scoping problem which was not the case.

behind the scenes, the AJAX requests are asynchronous. in the working javascript there is an array (list) that keeps track of the pending AJAX requests. on AJAX success, the list entry corresponding to the url is deleted and the response is pushed to the cache which is used to display the tooltip with exactly one AJAX request per unique url.