Im having a strange issue in my NodeJS app. Im using
function getFile(filename, cb){
fs.readFile(filename, 'utf8', (err, data) => {
if(err){
throw err;
return;
}
return cb(data);
});
}
to open an html file, get its contents and send to the client for different modal screens. However, the first html file it opens seems to be getting cached, somehow. I know there's no real caching in the nodejs fs, so Im unsure as to where the problem could be stemming from. Ive ensured that the correct values are in fact being passed into the function, but the output is always the first file opened. How can I stop this from happening?