YSlow: Avoid empty src or href

Recommendations

Lighthouse
Metrics
Audits
PageSpeed (Legacy)
YSlow (Legacy)

Overview

Empty src or href attributes can cause multiple problems.

How does your site score on this recommendation?

Details

You might expect a browser to do nothing when it encounters an element with an empty src or href attribute, however this is not the case in a considerable number of browsers. As of 2016, IE and Edge will both make a request to the page’s parent directory, while Firefox and older Webkit browsers (like Safari) will re-request the page itself! This behavior could potentially corrupt user data, waste server computing cycles generating a page that is never viewed, or in the worst case, cripple your servers by sending them a large amount of unexpected traffic.

Problem Element–Attribute Pairs in Modern Browsers

According to our research, these three pairs will cause needless requests in IE 10+ & all versions of Edge:

  
  
  


Likewise, these two appear to affect all versions of Firefox: