-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
Describe the bug
Our web application is running on Microsoft Azure App Service and is published through Azure Frontdoor which is a CDN which
caches all responses to GET requestes which are deemed as "cacheable".
The server response to the a client's first request which returns the sid to be used for all subsequent requests does not have Cache-Control headers and so the reponse gets cached by Frontdoor CDN which will result in other users receiving this cached response instead of a "fresh" one.
The subsequent request uses the session ID from the cached response which probably belonged to another user and might not be valid anymore:
To Reproduce
Socket.IO server version: 4.4.1
Server
let server = http.createServer(app);
let socketio = SocketIO(server);
// General server listening
server.listen(config.server.port, function () {
logger.info('Express server listening on port ' + server.address().port);
});
socketio.on('connection', function (socket) {
logger.debug('Client with SocketId [%s] connected ...', socket.id);
});Socket.IO client version: 4.4.1
Client
initSocket: function (oController) {
if (!this.oSocket) {
this.oSocket = io();
this.oSocket.on('myevent', function (oData) {
var oReceived = JSON.parse(oData);
// Do something with the data....
}
},Expected behavior
Every response should have http header
Cache-Control: no-store, no-cache
Platform:
- Device: PC
- OS: Windows 10
Additional context


