Expires Headers for SEO

by Nipun Tharuksha   Last Updated August 07, 2019 04:04 AM

I am trying to decrease the loading time of my website which is hosted in Bluehost. So when I check the performance scores via GTmetrix under YSlow section it mention to Add expire headers for four static components as below.

Add Expires headers

There are 4 static components without a far-future expiration date.

    https://www.googletagmanager.com/gtag/js?id=UA-49812165-2
    https://www.google-analytics.com/analytics.js
    https://www.trustedsite.com/rpc/ajax?do=tmjs-visit&host=surf2ship.com&rand=1565102041274
    https://cdn.ywxi.net/meter/surf2ship.com/105.png

So to have a better answer for this I have google the issue and below links were studied

  1. moz.com post which is published on 2012
  2. Stackoverflow post - Add Expires headers - which is published on 2013

All of above pages explain how to add expire headers for common file types.For a example see below .htaccess file. It specify all common formats rather than specifying a exact source.

# Media: images, video, audio
  ExpiresByType audio/ogg "access plus 1 month"
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"

So my problem is

How to add Expire headers for a specific url? Like for `https://www.google-analytics.com/analytics.js`

Any recommendation or link will be perfect to grab some knowledge.

Thanks



Related Questions


Updated March 05, 2018 22:04 PM

Updated May 01, 2016 08:01 AM

Updated February 01, 2018 01:04 AM

Updated July 03, 2015 13:01 PM