Node.js Caching Benefits and Overview
This feature will only work with .NET Core applications targeted for .NET Framework platform.
As HTTP is a stateless protocol, a web application needs to track requests coming from the same user and store that session related data somewhere. By default, session data is usually stored in memory on the web server. Memory session store data might get wiped out incase the web server goes down or gets restarted. Therefore, usage of external persistence storage is a better option.
With the usage of Node.js in Client Side features, NCache has introduced Sessions for Node.js to provide support for 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 is running in a web server farm and you need a reliable and scalable storage for your session persistence, then NCache is the best available option.
NCache as a Session Store
Better Performance: Session data being stored in in-memory cache, yields maximum performance and faster response time.
Scalability: It is an in-memory distributed cache which provides linear scalability. As your cache cluster nodes need to cater 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 also results handling larger load because sessions can be distributed to multiple servers in the farm
Reliability: With NCache, session data is stored in the cache cluster. So in case the application server goes down, session data remains available when application server comes back.
Session Lookup in Cache Made Easy: All session data in cache can be retrieved in a single call. NCache provides tag with session. In one single operation all session data with tag can be easily fetched.
Session Management in Node.js
Express is a Node.js web application sever 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 application.