SlideShare a Scribd company logo
Simple server side cache 

for Express.js with  Node.js
Source Code
https://github.com/gokusenz/server-side-cache-express
What is Caching?
What is caching?
Caching is a commonly used technique to improve the performance of
any application, be it desktop, mobile or web. When dealing with web
applications we can make good use of client-side caching using response
headers that all browsers currently support.
What is caching in web
application?
Web application caching is the process of storing dynamically generated
data for reuse and leaving data closer to the end user.
How Caching Works
Traditional Data Query 

(Without Cache)
Query
Get Rows From
Database


Return Rows to
Application
Cached Data Query
Query
Data
In
Cache
Get Rows
From Database
Return Row to
Application
Insert Rows
Into
Cache
Cache
Storage
Database
Yes
No
Why we use?
➔ Better performance
◆ System loads faster/better responsiveness
➔ Better scalability
◆ Limit bottlenecks in a system
➔ Better robustness
◆ Can support more load
Caching
Terminology
[ Cache Hit ]
when requested data is contained in the cache
[ Cache Miss ]
when requested not in the cached, has to be
recomputed or fetched from original storage
[ Cache Key ]
unique identifier for a data item in the cache
[ Expiration ]
item expires at a specific date (absolute),
specifies how long after an item was last
accessed that is expires (sliding)
[ Backing store ]
persist cached data on disk
[ Cache Scavenging ]
deleting items from the cache when
memory is scarce
[ Local Cache ]
caching data on clients rather than on
servers
[ Distributed Cache ]
extension of the traditional concept
of cache that may span multiple
servers
Advantages
❖ Speed up application
❖ Less Resources Used
❖ Reuse content
Disadvantages
❖ Stale Data
❖ Overhead
❖ Complexity
Type Of Caching
❑ Client Caching
- browser caches URLs for future uses
- Mozilla Firefox, Google Chrome
❑ Proxy Caching
- proxy server caches most requested URLs
- Varnish ( reverse proxy )
- CDN ( forward proxy )
❑ Server-side Caching
- server side cache reduces load on server
- File System Cache
- In-Memory Cache (MemCached, Redis)
File Cache
A file of data on a local hard drive. When
downloaded data are temporarily stored on the
user's local disk or on a local network disk, it
speeds up retrieval the next time the user
wants that same data (Web page, graphic, etc.)
from the Internet or other remote source.
In-Memory means 

We are Bound By RAM
MemCached
Memcached is an in-memory key-
value store for small chunks of
arbitrary data (strings, objects)
from results of database calls, API
calls, or page rendering.
Redis
Redis is an open source, advanced
key-value store. It is often referred
to as a "data structure server" since
keys can contain strings, hashes,
lists, sets and sorted sets.
How to use?
[ File System Caching ]
➔ It works without any
additional server. Most of the
CMS by default use file cache
without any configurations.
[ In-Memory Caching ]
➔ Need to install and configure
cache server
➔ Need client library to access
cache
➔ Most of the popular
framework has very good
built-in or third-party library.
Simple server side cache for Express.js with Node.js
Demo Time !
https://github.com/gokusenz/server-side-cache-express

More Related Content

PDF
Docker 101: Introduction to Docker
PPTX
A Brief Introduction to React.js
PPT
Codeigniter
PPT
Design Pattern For C# Part 1
PPTX
Facade Design Pattern
PDF
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
PPTX
Boost Your Neo4j with User-Defined Procedures
PDF
Docker architecture-04-1
Docker 101: Introduction to Docker
A Brief Introduction to React.js
Codeigniter
Design Pattern For C# Part 1
Facade Design Pattern
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Boost Your Neo4j with User-Defined Procedures
Docker architecture-04-1

What's hot (20)

PDF
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
PDF
Gradle Introduction
PPTX
Requirement engineering evaluation
PDF
Deep Dive into Docker Swarm Mode
PDF
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
PPTX
Docker introduction for the beginners
PDF
Docker 101 - from 0 to Docker in 30 minutes
PDF
Modern Data Platforms
PDF
Scaling up task processing with Celery
PDF
Workshop 21: React Router
PDF
A Framework Driven Development
PPT
Building Oracle BIEE (OBIEE) Reports, Dashboards
PDF
Introduction to Docker
PPTX
ODP
CompletableFuture
PPTX
Triplestore and SPARQL
PPTX
RESTful API - Best Practices
PDF
Git 101: Git and GitHub for Beginners
PPTX
PPTX
Introduction to MongoDB
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
Gradle Introduction
Requirement engineering evaluation
Deep Dive into Docker Swarm Mode
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Docker introduction for the beginners
Docker 101 - from 0 to Docker in 30 minutes
Modern Data Platforms
Scaling up task processing with Celery
Workshop 21: React Router
A Framework Driven Development
Building Oracle BIEE (OBIEE) Reports, Dashboards
Introduction to Docker
CompletableFuture
Triplestore and SPARQL
RESTful API - Best Practices
Git 101: Git and GitHub for Beginners
Introduction to MongoDB
Ad

Similar to Simple server side cache for Express.js with Node.js (20)

PPTX
Mini-Training: To cache or not to cache
PPTX
HTTP Caching.pptx
PPTX
Distributed Cache with dot microservices
PPTX
Cache Rules Everything Around Me - Momentum - October 2022.pptx
PPTX
Cache Rules Everything Around Me - DevIntersection - December 2022
PPTX
CREAM - That Conference Austin - January 2024.pptx
PPTX
Caching
PPTX
Introduction to Redis and its features.pptx
PDF
Don’t give up, You can... Cache!
PPTX
Selecting the right cache framework
PPT
Caching fundamentals by Shrikant Vashishtha
PPT
Web Application Cache (APC, Memcache)
PPTX
Caching
PPTX
[Hanoi-August 13] Tech Talk on Caching Solutions
PDF
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
PPTX
Web Caching Systems improve web performance by storing frequently accessed re...
PPTX
Cache is king
PPT
Web Speed And Scalability
PPTX
Cache is your best friend
PPT
Caching for J2ee Enterprise Applications
Mini-Training: To cache or not to cache
HTTP Caching.pptx
Distributed Cache with dot microservices
Cache Rules Everything Around Me - Momentum - October 2022.pptx
Cache Rules Everything Around Me - DevIntersection - December 2022
CREAM - That Conference Austin - January 2024.pptx
Caching
Introduction to Redis and its features.pptx
Don’t give up, You can... Cache!
Selecting the right cache framework
Caching fundamentals by Shrikant Vashishtha
Web Application Cache (APC, Memcache)
Caching
[Hanoi-August 13] Tech Talk on Caching Solutions
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Web Caching Systems improve web performance by storing frequently accessed re...
Cache is king
Web Speed And Scalability
Cache is your best friend
Caching for J2ee Enterprise Applications
Ad

Recently uploaded (20)

PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PTS Company Brochure 2025 (1).pdf.......
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
2025 Textile ERP Trends: SAP, Odoo & Oracle
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
CHAPTER 2 - PM Management and IT Context
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Designing Intelligence for the Shop Floor.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Design an Analysis of Algorithms I-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Navsoft: AI-Powered Business Solutions & Custom Software Development
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
wealthsignaloriginal-com-DS-text-... (1).pdf

Simple server side cache for Express.js with Node.js

  • 1. Simple server side cache 
 for Express.js with  Node.js
  • 4. What is caching? Caching is a commonly used technique to improve the performance of any application, be it desktop, mobile or web. When dealing with web applications we can make good use of client-side caching using response headers that all browsers currently support.
  • 5. What is caching in web application? Web application caching is the process of storing dynamically generated data for reuse and leaving data closer to the end user.
  • 7. Traditional Data Query 
 (Without Cache) Query Get Rows From Database 
 Return Rows to Application
  • 8. Cached Data Query Query Data In Cache Get Rows From Database Return Row to Application Insert Rows Into Cache Cache Storage Database Yes No
  • 9. Why we use? ➔ Better performance ◆ System loads faster/better responsiveness ➔ Better scalability ◆ Limit bottlenecks in a system ➔ Better robustness ◆ Can support more load
  • 10. Caching Terminology [ Cache Hit ] when requested data is contained in the cache [ Cache Miss ] when requested not in the cached, has to be recomputed or fetched from original storage [ Cache Key ] unique identifier for a data item in the cache [ Expiration ] item expires at a specific date (absolute), specifies how long after an item was last accessed that is expires (sliding) [ Backing store ] persist cached data on disk [ Cache Scavenging ] deleting items from the cache when memory is scarce [ Local Cache ] caching data on clients rather than on servers [ Distributed Cache ] extension of the traditional concept of cache that may span multiple servers
  • 11. Advantages ❖ Speed up application ❖ Less Resources Used ❖ Reuse content Disadvantages ❖ Stale Data ❖ Overhead ❖ Complexity
  • 12. Type Of Caching ❑ Client Caching - browser caches URLs for future uses - Mozilla Firefox, Google Chrome ❑ Proxy Caching - proxy server caches most requested URLs - Varnish ( reverse proxy ) - CDN ( forward proxy ) ❑ Server-side Caching - server side cache reduces load on server - File System Cache - In-Memory Cache (MemCached, Redis)
  • 13. File Cache A file of data on a local hard drive. When downloaded data are temporarily stored on the user's local disk or on a local network disk, it speeds up retrieval the next time the user wants that same data (Web page, graphic, etc.) from the Internet or other remote source.
  • 14. In-Memory means 
 We are Bound By RAM
  • 15. MemCached Memcached is an in-memory key- value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
  • 16. Redis Redis is an open source, advanced key-value store. It is often referred to as a "data structure server" since keys can contain strings, hashes, lists, sets and sorted sets.
  • 17. How to use? [ File System Caching ] ➔ It works without any additional server. Most of the CMS by default use file cache without any configurations. [ In-Memory Caching ] ➔ Need to install and configure cache server ➔ Need client library to access cache ➔ Most of the popular framework has very good built-in or third-party library.