Fork CMS Compression Module
The Fork CMS Compression module let's you compress PNG & JPG images on your website. Use this module to shrink images on your site so they will use less bandwidth and your website will load faster. The compression module uses the free API of TinyPNG and TinyJPG.
Backend + statistics:
I did the test with 3 images (3264x2448 resolution) taken from my camera. I uploaded and inserted the photos on a Fork CMS page and used the compression module. I went from 8.2MB to 1.5MB for the three images together!
- Upload the
/src/Backend/Modules/Compressionfolder to your
- Browse to your Fork CMS backend.
- Go to
Settings > Modules. Click on the install button next to the Comprossion module in the uninstalled list.
- Go to
Settings > Modules > Compressionto use it.
How to use it
- Get a free API key (500 images/month for free) here
- Go to
Settings > Modules > Compressionand enter your API key
- In the tree structure, choose a few folders with images to compress. Press save. Then press the execute button to start compression.
- Use a cronjob if you want to compress these images once in a while, or press the execute button to compress the images on the fly.
Note: We store a history of compressed files in the database with a checksum. By doing that, we can ignore files that already have been compressed and ignore them when a new compression task starts.
If you encounter any bugs, please create an issue and I'll try to fix it (or feel free to fix it yourself with a pull-request).