if the server is linux, the filesystem is most probably EXT, therefore accept filesystem level symlinks that are like real files to the applications, ex.:
SomeImg.jpg (real image file)
1) convert to webp keeping its whole filename, this grants will not conflict with a possibly existing other file named like "SomeImg.webp"
SomeImg.jpg.webp (real, quite small, image file)
3) symlink (this is the magic)
SomeImg.jpg -> SomeImg.jpg.webp (symlink pointing to the new file)
And then a symlink was created, with the same name of the old file (what all applications will use transparently, w/o problems, nothing will break unless the application is prepared to reject symlinks what would be quite unusual).