This probably needs a different title as it implies it's a general resource page (and not a page about third-party resources). The information here is still relevant, albeit dated (e.g. bundling based on how the assets are actually used isn't discussed, inlining resources for performance isn't discussed).
JavaScript Files
The script elements to include a document's JavaScript files should be
placed directly before a document's closing body tag:
This is because JavaScript files are a "blocking resource" that will prevent
the browser from downloading other resources on the page while downloading the
script.
Content Delivery Networks
A content delivery network (CDN) is a distributed system of servers that can
be leveraged to quickly serve web resources to users. Using a CDN to serve
popular JavaScript or CSS libraries has a number of benefits, including
decreased latency and the ability to leverage caching. The following example
serves the popular jQuery library from Google's CDN:
JavaScript and CSS files should be minified. Minification is the process of
condensing JavaScript and CSS files to only include the required content. For
example, spaces can be removed from CSS files and the names of local variables
can be shortened in JavaScript files. A number of tools exist for accomplishing
this task.
Concatenating Resources
JavaScript and CSS files should also be concatenated, or combined together
into a single file. In other words, rather than referencing multiple JavaScript
files on a page, these scripts should be concatenated into a single JavaScript
file. This improves performance by reducing the number of separate
connections the browser needs to establish while loading a page.
HTTP/2
Web servers are gradually upgrading to a new version of the HTTP protocol,
HTTP/2, which includes a number of improvements to performance. Specifically,
HTTP/2 will allow multiplexing, or the ability to send multiple requests over
a single TCP connection, which may actually obviate the need for concatenation
and other HTTP/1-specific hacks.
384
Legacy Page https://webguide.ucsb.edu/resources/
Location in New Hierarchy ???
This probably needs a different title as it implies it's a general resource page (and not a page about third-party resources). The information here is still relevant, albeit dated (e.g. bundling based on how the assets are actually used isn't discussed, inlining resources for performance isn't discussed).
JavaScript Files
The
script
elements to include a document's JavaScript files should be placed directly before a document's closingbody
tag:This is because JavaScript files are a "blocking resource" that will prevent the browser from downloading other resources on the page while downloading the script.
Content Delivery Networks
A content delivery network (CDN) is a distributed system of servers that can be leveraged to quickly serve web resources to users. Using a CDN to serve popular JavaScript or CSS libraries has a number of benefits, including decreased latency and the ability to leverage caching. The following example serves the popular jQuery library from Google's CDN:
Minified Resources
JavaScript and CSS files should be minified. Minification is the process of condensing JavaScript and CSS files to only include the required content. For example, spaces can be removed from CSS files and the names of local variables can be shortened in JavaScript files. A number of tools exist for accomplishing this task.
Concatenating Resources
JavaScript and CSS files should also be concatenated, or combined together into a single file. In other words, rather than referencing multiple JavaScript files on a page, these scripts should be concatenated into a single JavaScript file. This improves performance by reducing the number of separate connections the browser needs to establish while loading a page.
HTTP/2
Web servers are gradually upgrading to a new version of the HTTP protocol, HTTP/2, which includes a number of improvements to performance. Specifically, HTTP/2 will allow multiplexing, or the ability to send multiple requests over a single TCP connection, which may actually obviate the need for concatenation and other HTTP/1-specific hacks.