Node.js Caching Benefits and Overview
This feature will only work with .NET applications that target the .NET 4.8 platform.
Since HTTPS is a stateless protocol, a web application needs to track requests from the same user and store that session-related data somewhere - session data exists in memory on the web server by default. The memory session store data might get wiped out in case the web server goes down or gets restarted. Therefore, the usage of external persistence storage is a better option.
Along with using Node.js in its client side features, NCache has introduced Sessions for Node.js to support the new architecture. NCache provides a session store for session data storage in Node.js to boost the overall performance of your application. If your application runs in a web server farm and you need reliable and scalable storage for your session persistence, then NCache is the best option.
NCache as a Session Store
Better Performance: Session data stored in an in-memory cache yields maximum performance and faster response time.
Scalability: It is an in-memory distributed cache that provides linear scalability. As your cache cluster nodes cater to extreme transaction loads, you can achieve as much scalability as needed.
Availability, Load Balancing: In a web farm environment, using NCache with Node.js Sessions, provides better fault tolerance, keeping session data available at all server nodes in a clustered cache. This availability also results in handling a more considerable load because sessions can be distributed to multiple servers on the farm.
Reliability: With NCache, session data exists in the cache cluster. So in case the application server goes down, session data remains available when the application server comes back.
Session Lookup in Cache Made Easy: All session data in the cache can be retrieved in a single call. NCache provides a tag with the session. All tag session data is easily fetched in one single operation.
Session Management in Node.js
Express is a Node.js web application server framework specifically designed to build mobile and web applications. Node.js uses Express-session middleware to manage sessions. By default, Express provides server-side session storage but, it also gives the facility to make your own custom store whilst the rest stays the same.
In this chapter, you will learn how to configure NCache as a session store for your Node.js application.
In This Section
Configure Sessions in Node.js
Explains how to configure and use NCache as a session store for Node.js applications.