Monthly Archives: August 2014

Optimize images in CRON job

Google PageSpeed Insights may complain about images being not compressed enough. There are techniques which ensure lossless compression. When using JPG images you may compress them using jpegoptim, which may be run from the command line.

jpegoptim -s /var/www/html/images/*.jpg

The command will go through all jpg images in that folder and will perform lossless compression. The -s parameter will also ensure that all markers (eg. comments and EXIF data) will be removed.