While the cache works for JSON responses, it doesn't work for images delivered as a stream. In this video, learn how to add a simple filesystem based cache.
- [Instructor] As mentioned, we don't cache images right now … because our caching system does not work with streams. … Let's try that out real quick. … So I'm in my speaker service and there, … I disable the image handling middleware … and I restart it. … And back on the page, … we see that we don't get any images now. … Let's change it back real quick and restart, … and it works again. … This is because we are using the response type stream here. … So we have to add functionality now … that let's us also cache images … and we will do that in the file system. … For that I create in the root of the conference app … a new folder and I call it _imagecache. … So this is something you would not commit … to version control system, … it's just for the locally running app. … Now, on our speakers chest class, … I will add const. … Fs because we want to utilize file system functions … require fs. … I am also bringing in util const util equals require util … and in I want to create a promisified version of fs existed. …
- Setting up a service registry
- Registering and deregistering services
- Versioning and load balancing
- Adding the service logic
- Working with the circuit breaker
- Using queues
- Consuming and storing feedback
Skill Level Intermediate
Node.js: Debugging and Performance Tuningwith Jon Peck2h 44m Intermediate
1. Get started with Microservices
2. Creating a Service Registry
3. Splitting Up a Monolith into Microservices
4. Adding Fault Tolerance and Resilience
5. Using Queues with Node.js
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.