Building Custom Response Objects

  Рет қаралды 4,648

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер
@UliTroyo
@UliTroyo 2 жыл бұрын
I have read the MDN article about five times, and I still hadn't understood why one needs to clone(). Really helpful video!
@oah8465
@oah8465 2 жыл бұрын
it is a crime you don't have 1M subs. Thx a ton.
@leolowe22
@leolowe22 8 ай бұрын
@SteveGriffith-Prof3ssorSt3v3 as am I correctly understanding, if we receive some response from the server its always a Response Object and we store it in the CacheAPI, Also to start with on initial load we also access some files on the domain and store it in the CacheAPI and that too are also response objects, and the above scenario is the use case where we have some ui rendered from the caches we may have from earlier connections to the server , it may contain may be a file uploader or an image uploader input, so until the browser establishes connection with the server, we still provide a rich experience to the user to let them use the app perform uploads convert those resources to valid Response objects and store it in the CacheAPI and next time whenever the app goes online again, the same gets persisted on the api server from the Cache API with some persistence approach we can write down with the SW.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 7 ай бұрын
You can save things in either the Cache API or IndexedDB when offline and then sync to the server when back online. In the CacheAPI you are saving response objects. In the IndexedDB you are saving data like JSON.
@marie-elizeventer7080
@marie-elizeventer7080 2 жыл бұрын
Thanks! This tutorial came just at the right time! Very clear instruction as always
@anwayarath6453
@anwayarath6453 2 жыл бұрын
This is awesome.
@johnm8358
@johnm8358 2 жыл бұрын
so doing this is a fall back when your backend is down?...
@MrPaul_O
@MrPaul_O 2 жыл бұрын
I think it's more for handling when maybe the client has a limited connection. He mentioned an offline app, as well as caching data responses so that maybe there are less calls to the backend and can be handled by a service worker active in the background.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
Service Workers act like Proxy Servers - in between your web page and the web server. They will observer every request that comes from the browser and get to choose what happens. They could forward a request to the web server OR just send a Response that they build. Also, if you want to save something in the Cache, from your web page or from a Service Worker then you need to have a Response object to save.
@MrPaul_O
@MrPaul_O 2 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 does that mean you'd use it to store an asset to the browser's cache and your browser can choose not to request\fetch it on subsequent visits? I feel there's already a cache in the browser. Or are you referring to a different scenario\cache?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
@@MrPaul_O the browser cache and the cache api are two separate things. kzbin.info/www/bejne/faaTpWV7jJeenLc
@amircahyadi9219
@amircahyadi9219 2 жыл бұрын
Thrid one 👍
@fsbgaming1588
@fsbgaming1588 2 жыл бұрын
ah yes more service worker. nice.
Service Workers - waitUntil, skipWaiting, and claim methods
18:52
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
Deep Dive into Blobs, Files, and ArrayBuffers
17:42
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 38 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Service Workers - Messaging between Tabs and Service Workers
23:01
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 8 М.
Understanding Passing by Reference or Value in JavaScript
13:17
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
How I Use The Generic Repository Pattern In Clean Architecture
17:15
Milan Jovanović
Рет қаралды 41 М.
HTML5 File and FileList Objects
15:33
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 10 М.
Intro to Typed Arrays in JavaScript
9:22
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 24 М.
Service Workers - The Cache API
29:48
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 17 М.
Why I Use The Unit of Work Pattern With EF Core | Clean Architecture
11:34
Building Real-time Apps with Go | Azim Pulat
54:58
Azim Pulat
Рет қаралды 90 М.