BTW, you can also use Optimole on static sites or non WordPress sites. Create an account, keep note of the API key. Then paste this code in the head tags: https://github.com/robertzo/Random-Code/blob/main/Optimole%20Code
Make sure to replace your key with your API key. You can also change the settigs to your liking.
Then on every image instead of using this attribute:
<img src="your image url"/>
Use this
<img data-opt-src="your image url" width="800" height="600" />