I-Google PageSpeed ​​Insights vs. Uhlalutyo lukaGoogle

Izixhobo zokuqinisekisa ezinje nge- W3C yokuPhawula ukuSebenza kweNkonzo okanye iGoogle PageSpeed ​​Insights ziluncedo ekuvavanyeni ikhowudi kunye nokusebenza kwewebhusayithi. UGoogle ngokukodwa uchaphazela lonke ishishini elinamagqabantshintshi anje ngentla kwesibonda- kwaye ikwabonelela ngezikhokelo ezingqongqo kodwa eziluncedo zoxinzelelo lomfanekiso kunye nokugcina i-caching. Nangona kunjalo, inokwenzeka into yokuba uGoogle azinyathele ngeenyawo zakhe.


Ngaba ikhowudi yokulandela umkhondo yeJavaScript

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12350231-1', 'auto');
  ga('send', 'pageview');

Idityaniswe nguGoogle Analytics kwiwebhusayithi njengoko kuchaziwe ngokusemthethweni , uGoogle ukhalazela ukungabikho kwesikhangeli se- browser:

I-Google PageSpeed ​​Insights vs. Uhlalutyo lukaGoogle

Ngelishwa, ngobuchwephesha kuphela umphathi wefayile, kule meko nguGoogle uqobo, onokuyilungisa kwaye kunokwenzeka ukuyilungisa ngolu hlobo lulandelayo: Ugoba i-URL

(window,document,'script','//www.google-analytics.com/analytics.js','ga');

kwiseva yakho

(window,document,'script','analytics.js','ga');

kwaye icwangcisa umsebenzi olula wekhron nge-PHP, ekhuphela iifayile zejs zamva nje kwiserver yayo yonke imihla:

file_put_contents("analytics.js", fopen("https://www.google-analytics.com/analytics.js", 'r'));

Emva koko unokuyihlengahlengisa i-caching ukuze iPageSpeed ​​ingaphinde igxeke impazamo:

I-Google PageSpeed ​​Insights vs. Uhlalutyo lukaGoogle

Emva