If you got a lots of images you can save many of bytes by just compress images without losing any quality and discrease your website page size.
First we going to install jpegoptim + optipng
# yum install optipng
# yum install jpegoptim
How works optipng ?
How works optipng ?optipng file optipng [options] file optipng [options] input.png
jpegoptim file.jpeg jpegoptim [options] file.jpegFirst we go check how fast is your website and what your page size isjpegoptim photo.jpeg
- Check your site on: http://tools.pingdom.com/fpt/
- SAMPLE: 1.87s Load time / 2.3 MB Page size
- Check where your most images are e.g /wp-content/ or /images/
Now we gonna start optimize PNG & JPG/JPEG!
# cd /home/user/domains/domain.com/public_html/wp-content/uploads/
# all images in current directory: jpegoptim *.jpg
# or jpegoptim */*.pg (all directories) or 1 image: jpegoptim image1.jpg
# all images in current directory: optipng *.png
# or optipng */*.png (all directories) or 1 image: optipng image1.png
More information:
http://freecode.com/projects/jpegoptim
http://optipng.sourceforge.net/
find -type f -name "*.png" -exec optipng {} \;
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;
find -type f -name "*.jpeg" -exec jpegoptim --strip-all {} \;