general web Flashcards
what is DOM
document object model. its a tree like structure that holds all our html starting with the root node aka document
what is window?
window is the execution context and global object
what is navigator?
object in the global context that can give us some information about the client
what is http
It’s an application-layer protocol that defines how messages are formatted and transmitted between web browsers and servers. HTTP operates on a request-response model: clients (usually web browsers) send requests to servers, which then respond with the requested data. The protocol is stateless, meaning each request is independent of any previous requests. HTTP supports various methods (GET, POST, PUT, DELETE, etc.) for different types of interactions with resources. HTTPS is the secure version of HTTP, using encryption to protect data in transit.
what is indexeddb? indexeddb vs localstorage?
indexeddb has many advantages over localstorage. Most importantly for my project it can be used by web workers.
LocalStorage is synchronous and blocks the render thread while saving/loading, IndexedDB is asynchronous and so even if running on the main render thread, it will be co-operatively scheduled.
LocalStorage can only store strings, but IndexedDB can store binary data.
LocalStorage has a much smaller maximum data cap which varies between browsers, so, if storing a sizeable JSON string, you will probably need LZ compression, which isn’t necessary with IndexedDB.
IndexedDB’s API is a mess, LocalStorage is simple, but things like Dexie make this a non-concern.