I think ssds age faster if you do a lot of write calls. So better use /tmp which could be mounted to ram or tempfs by the user see https://unix.stackexchange.com/questions/55773/move-tmp-to-ram
Or maybe even try to not write to file at all and use pipes or environment variables