The image is an example of the http node.
Here you have to do it in the settings file by combining Steve's message and mine
httpStatic: [
{
path: '/home/username/.node-red/node-red-static/',
root: '/static/',
middleware: function (req, res, next) {
const ext = path.extname(req.url);
// Check if the request is for JPG or PNG images
if (ext === '.jpg' || ext === '.png') {
// Set Cache-Control header for images
res.setHeader('Cache-Control', 'public, max-age=86400');
}
// Continue to the next middleware
next();
}
}
]
Like Steve said, it's not sure to work