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
- moz.com post which is published on 2012
- 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
Aucun commentaire:
Enregistrer un commentaire