The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Responsive design and PageSpeed Insights Reply To: Responsive design and PageSpeed Insights


Google’s got it’s own recommendation there. :-)



  var cb = function() {
    var l = document.createElement('link');
    l.rel = 'stylesheet';
    l.href = 'mobile.css';
    var h = document.getElementsByTagName('head')[0];
    h.parentNode.insertBefore(l, h);
  var raf = requestAnimationFrame || mozRequestAnimationFrame ||
    webkitRequestAnimationFrame || msRequestAnimationFrame;
  if (raf) raf(cb);
  else window.addEventListener('load', cb);

As far as I’ve seen, it only contributes 2 points though.

What Google doesn’t say – best to create a fallback. This is possible with HTML5 :

<noscript><link href="mobile.css" ... ></noscript>