phantomas icon indicating copy to clipboard operation
phantomas copied to clipboard

Critical path JS and CSS files

Open gmetais opened this issue 9 years ago • 0 comments

A idea for new metrics:

  • JS files on the critical path
  • CSS files on the critical path
  • fonts files on the critical path

These metrics would help developers to optimize their critical path and use technics like critical CSS extraction.

It might be a little hard to detect, the solution is to detect by elimination.

For a CSS: it's in the head, it was loaded before domContentLoaded, and it was not injected by appendChild or insertBefore.

For a JS: same as a CSS file + it wasn't a <script **async**>.

For a font: a little bit harder to detect. Checking if it was loaded before domContentLoaded should handle 99% of the cases.

It looks possible to me, but quite experimental :)

gmetais avatar Jan 30 '15 16:01 gmetais