Комментарии:
MJS files, ahh yes the Michael Jackson Files
ОтветитьGreat overview, thank you!
ОтветитьAs you mentioned in the beginning, the person on github updates information 3 times a day. How would you blow your cache? Is simpy using setTimeout and either runnining the function to eager load again or null out cache variable a good approach?
ОтветитьAlways knew to lazy load when it comes to large data but before this, I didn't know Lazy load was called Lazy load hahaha.
Ответить1. Thanks your are gr8
2. There is also a very nice combination with load balancer that can confuire on the fly the way you can use it depend on traffic :-)
I like to lazyload some things and eagerload others, often within the same application. Funny as it is, that’s basically what I was doing without even thinking about it when using docker-compose’s “depends_on” feature. So for example if I’m using Nginx as a reverse proxy to a Node.js/express backend, I need to start up the Node process first and have it be ready to go before starting up Nginx, or Nginx will exit with an error (eagerload). But if I want the Node backend to talk to another nonessential microservice, I can omit the “depends_on” flag so they both start loading at the same time and whichever one loads first doesn’t matter (lazyload).
While writing this I just realized that you could argue from the opposite perspective; that the first scenario is lazyloading and the second is eagerloading. Hmm...🤔
I always believed lazy loading was used on frontent for lazy loading UI components on basis of routes. Never knew it could be used on backend as well on microservices. Thanks!
Ответить