Page Speed: S3 recursive image optimization

30/04/2019

Page Speed: S3 recursive image optimization

30/04/2019

I have been recently involved in a website optimization project for SEO purposes. One of its major steps was the (lossless) image optimization to improve performances and, of course, to make sure to be Google Page Speed friendly.

Google Page Speed Insights

PageSpeed Insights is a tool from Google which “analyzes the content of a web page, then generates suggestions to make that page faster”.

Page Speed S3 recursive image optimization

Photo by Jannik Selz on Unsplash

It’s the base index for every website performace optimization and might as well be the index that Google uses in its search engine to adjust a website position to reflect its performaces (https://developers.google.com/speed/).

Let’s see how much we can improve.

Our own case

The website is a simple WordPress customization backed by AWS S3 for assets storage.

AWS S3 has no computational power but transfers between S3 and EC2 are very cheap (https://aws.amazon.com/s3/pricing/) so I decided to leverage an AWS EC2 spot instance to download each image, run the optimization and upload it back to the storage.

The process is pretty straightforward, but still a bit annoying to be done manually.

The automation

I created a simple bash script to automate the whole operation. I think may be useful for someone else out there, so here it is:

To use the script just download the Gist – make a backup -, make it executable – make a backup -, customize “credentials” and “configuration” sections – make a backup – and run it with:

./s3_recursive_image_optimization.sh

In case I forgot to mention: make sure to have a backup in case anything goes wrong.

Results

We are pretty happy with what we got, a straight “A”.

Also, since we automated to whole process, in case some images will not be optimized before being uploaded in the future we can still run the script again for the new ones.

If you’re wondering how your website is doing with Page Speed and other performance metrics, you can check it for free on GtMetrix: https://gtmetrix.com/.

Articoli recenti

Page Speed: S3 recursive image optimization

30/04/2019
I have been recently involved in a website optimization project for SEO purposes. One of its major steps was the (lossless) image optimization to improve performances and, of course, to make sure to be Google Page Speed friendly. Google Page Speed Insights PageSpeed Insights is a tool from Google which “analyzes the content of a […]

Trello + Zapier + Google Sheets = Time Tracking

28/03/2019
Trello, un tool di organizzazione con più di 10 milioni di utenti, è diventato uno strumento essenziale per la gestione dei miei progetti. Lo trovo un software fantastico, è molto flessibile e può essere adattato a molteplici esigenze. Inoltre è estremamente semplice da usare, tanto che spesso condivido le bacheche di progetto con il cliente […]

Blockchain backed assets management: Oblatum.

14/12/2018
Dealing with assets property certificates is, most of the times, cumbersome. In Italy when you buy a car you have to pay at least € 235 in property transfer. When you buy a house it starts from around € 5000. Even if you buy something not legally regulated but valuable (in terms of money) you need […]