How to Implement Caching in Angular | Caching API Response in Angular | Caching Techniques

  Рет қаралды 7,373

Brogrammers

Brogrammers

Күн бұрын

Пікірлер: 18
@iewebdevdes
@iewebdevdes 11 ай бұрын
This video was really helpful
@brogrammers
@brogrammers 11 ай бұрын
Love it 💙 Thank you for watching 🤞
@cherifbarry9107
@cherifbarry9107 6 ай бұрын
I would like to know if I have something like 5000 lines returne in an array. Is it possible to cache it these data??
@brogrammers
@brogrammers 6 ай бұрын
It should be fine. Storing high data in browser memory is not good though. Usually anything below 20mb is ideal to store in browser memory.
@cherifbarry9107
@cherifbarry9107 5 ай бұрын
@@brogrammers thank you for your return
@arpitmalaiya2825
@arpitmalaiya2825 Жыл бұрын
What about service worker, can we use that for caching api data
@brogrammers
@brogrammers Жыл бұрын
Technically you can use service worker to add caching behaviour on API but SW is not indented primary for API caching, i mean it can do lot more than just caching like e.g. offline forms & client side load balancing. It is like overkilling caching purpose by using SW, & you mostly don't want to add a dedicated JS process thread running in your browser just to cache some data if you're application code is already capable of doing same without it.
@TheZukkino
@TheZukkino Жыл бұрын
As you have spoken about local and session storage, could you make a video to transform a simple Angular Application in a PWA?
@brogrammers
@brogrammers Жыл бұрын
Thank you for suggesting. I will try it.
@armaanhadiq3741
@armaanhadiq3741 11 ай бұрын
What will be the age of cache data in first approach, like will i get the fresh response after some time or it will be cached there all the time.
@brogrammers
@brogrammers 11 ай бұрын
Thank you for great question 🙂 I was expecting this sooner or later. The way httpinterceptor store cache is it uses browser storage. But there are cache reset and refresh method available. Usually cache is refreshed with JWT token in practical way which is more secure (based on JWT token's life httpinterceptor decides to use cache or make new hit) . Long story short it uses browser storage (not session nor cookie)
@brogrammers
@brogrammers 11 ай бұрын
If you clear browser storage your cache is gone.
@armaanhadiq3741
@armaanhadiq3741 11 ай бұрын
greate @@brogrammers if we want the cache to be still there after reloading a page or switching between pages then we should use localstorage as a key value pair approach. Am i right ?
@brogrammers
@brogrammers 11 ай бұрын
You are right.
@henry_sparks
@henry_sparks Жыл бұрын
This is great but then how do you revalidate your cached data? Because after the first call and you set your cache then subsequent calls will get the cached data but how do you tell angular to revalidate that data?
@brogrammers
@brogrammers Жыл бұрын
To revalidate data we can put expiry to a data. It can be achieved in http interceptor case easily. Or you add your own expiry check logic. This can be added with help of jwt token module if you want to write 100% safe & secure validity logic.
@brogrammers
@brogrammers Жыл бұрын
There is something called 'If-Modfied-Since' header, we can set our expiry date on the HttpRequest.
How to share your RxJS observables for improved performance
10:24
Joshua Morony
Рет қаралды 24 М.
Deep Dive into HTTP Caching: cache-control, no-cache, no-store, max-age, ETag and etc.
21:28
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Angular Http Caching using Interceptor and Refresh
22:29
CodeWithSrini
Рет қаралды 8 М.
Cache Systems Every Developer Should Know
5:48
ByteByteGo
Рет қаралды 534 М.
Everything you need to know about HTTP Caching
13:33
the roadmap
Рет қаралды 162 М.
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 78 М.
Fast HTTP Caching With Angular HTTP Observables
9:57
Digital Fluency
Рет қаралды 43 М.
How to Become a Highly Employable C# Developer in 2025
20:10
Gavin Lon
Рет қаралды 4,1 М.
This is why you need caching
10:03
Web Dev Cody
Рет қаралды 48 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 910 М.
I bet you can understand NgRx after watching this video
22:48
Joshua Morony
Рет қаралды 196 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 81 М.