Optimize image weight


I am trying to optimize the loading time for my grav website.
On a page I have an image insterted with markdown. This image was optimized with https://tinypng.com/ and is 81kB

When I add the image and save, my page show the same image but 360kB ! Caching is increasing image weith !

I tried disabling image caching, it is good, but not for images with media manipulation (resize).

A solution?

I’ve run into exactly the same situation a few weeks ago. The short answer is that you need to disable “Cache all images” as its not possible to just cache images without them going through the optimisation process first - which sadly bulks them up.

I’ve written a bit more detail on an similar post here: https://discourse.getgrav.org/t/newbie-question-from-germany-images-in-cache-twice-as-big-as-originals-feature-or-bug/6045/5

I think Grav should use a better compression and optimisation for image caching, or test if cached image weight is bigger than original image and then use original for cache.

Disabling image caching is a good solution only for images without modification. Images with crop or resize effects are cached even if image caching is disabled.