

Reading Google pageSpeed insights on leverage browser caching, Google said they prefer Expires (for example “Expires, Fri, 14:19:41 GMT”) over Cache-Control: max-age (for example “Cache-Control: max-age=3600”) because it is more widely supported. To fully understand the concept of caching, i suggest your read Caching Tutorial by Mark Nottingham. if that person is to visit your site, rather than download the images again, the browser uses the images it has cached. when a user visit your website, the static images are downloaded from Amazon S3 servers and get saved inside his browser’s cache. Say you set cache control Header for s3 images to expire in 3 months time. Fast website loading speed – Aside the reduction in bill, it also significantly increase website loading speed.setting caching will reduce the number of request to images in your s3 bucket which in turn significantly reduce your bill.

though it relatively cheap, if you run a high traffic site, those little cent per GET request can quickly accumulate. Reduction in Amazon S3 Bill – One of the criteria use by Amazon s3 in calculating your bill is the number of GET request to your files.This means the amount of data the user’s browser has to download is less, and fewer requests need to be made to your server. Their first visit to your site will take the same time to load, however when that user revisits your website, refreshes the page, or even moves to a different page of your site, they already have some of the files they need locally. Browser caching can help by storing some of these files locally in the user’s browser. This includes all the HTML, CSS, JavaScript and images.

Below are screenshot of Google PageSpeed Insights and GTmetrix Performance result spotting caching absent.Įvery time a browser loads a webpage it has to download all the web files to properly display the page. Unlike the images served by my main web host, the images over at Amazon weren’t getting served with any expires headers at all. One of the contributing factor to this low performance score was due to the absent of expiry date or a maximum age in the HTTP headers for my static resources especially images served from Amazon S3. Performance score for the former was ranging from 68 – 80 and that of the latter was page speed of 84% and YSlow 64% which in turn are distributed by Cloudflare CDN.Īfterward, i did some testing using Google PageSpeed Insights and GTmetrix Website Speed and Performance Optimization tools. one of the method adopted was to move all my blog media files majority of which are images to my Amazon S3 bucket. I have been working hard to improve this blog loading speed and overall site performance.
