I’m about to deploy a firebase project using firebase database, storage, authentication, and cloud functions; and I intended to implement TLS session resumption as recommended in the firebase docs in order to lower costs and loading times.
I’ve been scavenging around the web for information on how to do this, but the best I’ve gotten is:
var tlsSessionStore = {};
server.on("newSession", function (id, data, cb) {
tlsSessionStore[id.toString("hex")] = data;
cb();
});
server.on("resumeSession", function (id, cb) {
var tlsSessionId = id.toString("hex");
cb(null, (tlsSessionId in tlsSessionStore) ? tlsSessionStore[tlsSessionId] : null);
});
Extracted from:
https://github.com/nodejs/node/issues/3132
Without a real description of what I would need to import to the project to make this work, or any explanation of what to do.
To be completely honest I’m a bit lost in the matter, as I wouldn’t even know how to apply this (using firebase cloud functions?), if this would apply to the connection to the database and storage, and finally, how I could test that everything is working once everything is done.
Are there any resources that could guide me through this process?