Is your website running slow? Reducing the size of the images will speed it up and you will get higher ranking in Google and other search engines.
In this video, I show you how to speedup your website by compressing png images in CentOS using optipng.
Commands:
- Install optipng:
yum install epel-release
yum install optipng
- To optimize all PNG pictures recursively In sub-folders cd to the parent folder
find -type f -name “*.png” -exec optipng -p {} \;
- To compress all PNG pictures in one folder: cd to the folder
optipng -p *.png
- To schedule the command in a cron job, put the path you want right after find:
find /home -type f -name “*.png” -exec optpng -p {} \;
Disclaimer: Use the above instructions at your own risk and always backup your images before performing any of these commands in case something goes wrong.
0 Comments