Despite uploading a HTML file by FTP takes a very short time only, I experience an HTML error or empty or incomplete page surprisingly often. And the Google and Ahrefs crawlers report such problems, too.
Unfortunately, FTP does not behave like Linux, where it is possible to replace one file by another in one single atomic action.
The FTP driver of WeeWX removes the old version of the file first, then uploads the new version. During the upload the web server delivers an incomplete page.
I wondered what I can do about it.
The first idea was to change ftpupload.py a little bit and upload the file with `.tmp` at the end. When the upload is completed, the old version of the file is removed and the uploaded file is renamed. So the file that the web server delivers is never any more incomplete. But the file can still be missing. That is within the time between the remove and the rename command.
Does someone know a real or at least better solution?
I am looking for something that does not require to change a core WeeWX file.