Key takeaways
- nopCommerce 5.0 has a per-request cache for every request and a static cache that is in-process memory unless you switch on distributed caching.
- Distributed caching has 4 types: memory, sqlserver, redis and redissynchronizedmemory. When you enable it, the default type is redissynchronizedmemory.
- Run more than one app instance? Use a distributed type, or each server keeps its own copy of the cache.
- nopCommerce caches data, not finished pages. Changes made through nopCommerce clear their own cache entries; direct SQL edits do not.
Caching decides whether a nopCommerce store survives a sale or slows down under ordinary browsing. Every page reads settings, the category tree, access rules, store mappings and localized strings, and caching keeps most of those reads out of the database.
This guide explains the layers, what changes when you add Redis, and why a change sometimes does not show up. We checked every setting and class name against the nopCommerce 5.00.1 source on 25 November 2026.
The Three Caching Layers in nopCommerce
The cache wiring sits in one place, the NopStartup class. It registers PerRequestCacheManager as the short-term cache for every request. Then it registers the static cache: MemoryCacheManager by default, or a distributed manager when DistributedCacheConfig is enabled.
| Layer | Class in 5.00.1 | Lives for |
|---|---|---|
| Per request | PerRequestCacheManager | One HTTP request |
| Static, one server | MemoryCacheManager | The app process, 60 minutes per entry by default |
| Static, shared | Redis, SQL Server or synchronized memory | Shared by every instance |
Your code does not see the difference. Services ask for IStaticCacheManager, and the configuration decides which implementation answers, so switching backends is a configuration change, not a code change.
Store slowing down under load? BSS tunes nopCommerce caching, hosting and code for stores that need to stay fast.
View nopCommerce servicesMemory Caching: The Default
A fresh install runs on MemoryCacheManager, an in-process cache registered as a singleton. Reads never leave the process, so it is the fastest option, and CacheConfig keeps each entry for 60 minutes by default.
Its limit is scope, not speed. The cache lives inside one process, so it starts empty after a restart, and two app instances behind a load balancer each keep their own copy. An admin change clears the cache on the instance that handled it; the others serve the old value until their entries expire.
The web farm trap
If your store runs on more than one server, or more than one container replica, memory cache alone gives different answers from different instances. "I changed a setting and only some visitors see it" is the classic sign. It is a configuration gap, not something to fix in code.
Before we change anything on a slow store, we ask one question: how many app instances serve it right now? If the answer is more than one and the cache is memory, that is usually the first fix.
Setting Up Redis as a Distributed Cache
Distributed caching is built into nopCommerce; no plugin is needed. It is configured in App_Data/appsettings.json, in the DistributedCacheConfig section, and it is off by default.
"DistributedCacheConfig": {
"Enabled": true,
"DistributedCacheType": "redissynchronizedmemory",
"ConnectionString": "your-redis-host:6379,password=your-password,ssl=True",
"InstanceName": "nopCommerce",
"PublishIntervalMs": 500
}
The 5.00.1 source offers four types. redis keeps the static cache in Redis, so every read is a network round trip. redissynchronizedmemory, the default when you enable the section, keeps reads in each server's local memory and uses Redis to tell the other servers what changed. sqlserver stores the cache in a database table (SchemaName and TableName), and memory uses ASP.NET Core's distributed memory cache.
Two settings are easy to miss. InstanceName partitions one Redis server between apps, such as staging and production. PublishIntervalMs batches the change messages that synchronized memory sends, every 500 milliseconds by default; set it to 0 to send each one at once.
| Your setup | Use | Why |
|---|---|---|
| One app instance | Default memory cache | Fastest, nothing to run |
| Two or more instances, Redis available | redissynchronizedmemory | Local-speed reads, shared invalidation |
| Two or more instances, no Redis | sqlserver | Shared cache in the database you already run |
Put Redis in the same region as the app servers, and restart the app after editing the file. If your hosting is still being planned, our nopCommerce hosting guide covers the server side.
Data Cache vs Page and Asset Caching
"Static cache" sounds like whole cached pages, but in nopCommerce it means application data: settings, categories, access rules and similar objects. The page is still built on every request, only from mostly cached data.
Our own store shows the split. A blog page comes back with Cache-Control: no-cache,no-store and the CDN passes it straight through. A product thumbnail comes back with Cache-Control: public, max-age=31536000 and a cache HIT at the edge.
So the layer above the data cache is ordinary web infrastructure: long cache headers on images, versioned CSS and JavaScript bundles, and a CDN in front. Our image optimization guide covers the image side.
How Cache Invalidation Works, and Where It Breaks
nopCommerce ties invalidation to entity events. CacheEventConsumer listens for inserted, updated and deleted events on each entity, and removes the related entries by key prefix, so one change clears every cached list that contains that entity.
There is also a scheduled ClearCacheTask that clears the whole static cache, and a Clear cache button in the admin header for doing it by hand.
Where a stale cache comes from
- SQL scripts and direct database edits raise no entity events, so nothing clears the cache. Click Clear cache afterwards.
- A plugin that keeps its settings in a private static field will not see changes; cache through
IStaticCacheManagerinstead. - Several instances on the default memory cache show a change on one server only. Switch to a distributed type.
- Two environments sharing one Redis server without different
InstanceNamevalues can read each other's entries.
After a migration or a bulk import that ran straight against the database, we click Clear cache before anyone tests the store. It saves an hour of chasing data that is already correct in the database.
A nopCommerce store that stays fast under load
BSS engineers set up Redis for web farms, chase stale-cache bugs and tune nopCommerce stores for peak traffic.
Frequently Asked Questions
Final Thoughts
nopCommerce's caching is well designed: one interface, a per-request layer and a static layer whose backend is a configuration choice. Most cache problems we see come from a mismatch, such as memory cache on a web farm, or data changed behind nopCommerce's back.
Count your instances, pick the backend from that, and clear the cache whenever data changes outside the admin. For the memory side of the same problem, see our high memory usage guide.
Tell us how your store is hosted. We will set up the right cache, fix stale data and test it under load.
Talk to an expert

