Obsidian Mkdocs Publisher : A free publish alternative

I don’t know js. Maybe check last modified property. Filepath is good and we must check it first, but we can compress file with pngquant, so the path is the same, but file is modified.
1 - get list of included images
2 - check filepat. Upload image if there is new filepath.
3 - check last modified property. Upload if changed. But you can make an option. A persion would have an ability to update everythoing. If he had modified files (compress, watermark) he can check"Refresh all published noites" to upload everything instead of Refresh published and upload new notes which must update little changes.

<script>
if (Date.parse(document.lastModified) != 0)
    document.write('<p><hr><small><i>Last modified: '
                   + document.lastModified
                   + '</i></small>');
</script>