[Solved] which one is better? a javascript stored on the root file or the link directly to the js?


js/example.js is 14 bytes. http://example.com/example.js is 30 bytes. The difference will be smaller once gzip compression is applied in transport.

The first one will be infinitesimally faster.


Loading time should not be a factor in your decision to use an absolute or relative URI.

0

solved which one is better? a javascript stored on the root file or the link directly to the js?