Slide 35
Slide 35 text
JS File splitting by loading timing
ࢀߟ: JavaScriptͷಡΈࠐΈλΠϛϯάผͷϑΝΠϧׂ
TIMING EXAMPLES IMPLEMENTATION
Immediately
͙͢ʹ࣮ߦ
Critical processes that are not
related to the DOM and can be
executed independently.
Sequential execution after loading
DOM
υΩϡϝϯτΛಡΈࠐΈޙɺॱ࣮࣍ߦ
Main processing of applications, etc. <script defer src="****">
Execute in free time after the page
is operational
ϖʔδ͕ૢ࡞Մೳʹͳͬͨޙɺ
ۭ͖࣌ؒʹಡΈࠐΜͰ࣮ߦ
Analytics, ad retargeting, tag
managers, etc.
after “DOMContentLoaded” with
RequestIdleCallback
Execute in free time after the
entire page has finished loading
ϖʔδશମΛಡΈࠐΜͩޙɺ
ۭ͖࣌ؒʹಡΈࠐΜͰ࣮ߦ
Sub-elements unrelated to content,
such as social networking widgets.
after window “loaded” with
RequestIdleCallback