Hello @sanjida !
Hope you’re having a good day!
The reason why Smush does not change the actual file name is due to two reasons:
1. The .htaccess rules make it possible to serve WebP to compatible browsers without having to do extensive work of updating the file names on the site itself – this avoids making actual changes to your site as the URLs of the images don’t have to be changed in all posts and pages. Therefore this allows non-destructive operation.
2. For the browser the extension doesn’t matter at all, it can be anything and the browser will completely disregard it. Instead, a browser will read the data in the file and based on the details in the file’s header it will decide which format it has and which codec to use to decode the image and display it.
So the extension can be .jpg (or anything else) but if the data is for WebP format, the browser will use the WebP codec.
This is a bit different from how for example Windows works (or used to work) where the extension decided the format of the file and if it didn’t match, that would cause an error. Browsers are fortunately based on a completely different mechanism.
Hope that clears things a bit ??
Kind regards,
Pawel