Learn JavaScript

Lesson 5 of 9 ¡ Forms, Storage and Small Apps

Module 15 ¡ Forms, Storage and Small Apps

Under the Hood: Origins, the Storage Event, the Main Thread and Cookies

ProReading

Arif's note taker from Lesson 03 is a success, and success brings new questions. A student opens it in two tabs, edits in one, and the other tab shows old notes. Another student pastes three thousand notes in, and every key press now stutters. A friend asks why the site's cookies are "slowing down every picture". Each question has its answer below the API, in how the browser keeps and moves this data.

Checking what this lesson needs for youâ€Ļ

What is inside Under the Hood: Origins, the Storage Event, the Main Thread and Cookies

  1. Storage belongs to an origin
  2. The storage event, from tab to tab
  3. A model of the rule, run under Node
  4. Synchronous on the main thread
  5. Lab: what a big save costs
  6. Saving less often
  7. What a cookie carries
  8. How JSON.stringify walks a state
  9. structuredClone and the stores that keep objects
  10. A Date is one number, and digits are a choice