Thanks for the reply
I added it the config, I had over 300 objects in the session database
Thanks for the reply
I added it the config, I had over 300 objects in the session database
Probably a minor thing, however, it will save memory and give a performance increase
When the compiler comes across a string that has been +'d together, for every +, it creates a new string in memory then waits for the old string to be garbage collected
Example
let user = 'svnty';
let date = Date.now();
let str = 'hello' + user + ' the date is ' + date;
It looks as if we have put two variables into a string, but the compiler has created a new string every time it comes across a + sign
So for the str
variable there has been 4 strings created in memory, only one of which is being used and the others just taking resources until out of scope
Solution
Use template literals with the back tick (or grave accent) `
Example
let user = 'svnty';
let date = Date.now();
let str = `hello ${user} the date is ${date}`;
Thanks for the reply
I added it the config, I had over 300 objects in the session database
Any way to turn off saveUninitialized for the cookies in the config?
Thanks, legends