How does Autoptimize and its Image Optimization + CDN service work?
If you turn on the setting "Optimize Images" (located on Settings > Autoptimize > Images), Autoptimize will analyze the code of your web pages every time a user visits them and it will replace each original un-optimized image with the optimized image. Each replaced image is served from the ShortPixel CDN.
Notice that Autoptimize does not touch any of your files on your server; Autoptimize optimizes your images on-the-fly, which means that if you want to return to your original images, you can simply disable the option "Optimize Images". This is the detailed process, completely transparent to all users:
- A user visits a page containing images.
- While the page is loading, Autoptimize checks for any image URLs on the code, for example:
- After detecting an image URL, it sends that image to ShortPixel's servers, which optimize it and store it on our CDN. This step is done only the first time a specific image size is requested.
- Then, Autoptimize replaces the URL with a new one, which points to our CDN containing the optimized image:
- Your page finishes loading and your images have been served from our fast CDN!