• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
Show / Hide Table of Contents

Create Client Cache

This cache exists on the client node. You can create a Client Cache in two ways, as described below.

If you are using NuGet packages without any NCache client installation, refer to Create Client Cache with NuGet Package Installation.

Important

Ensure that you have an existing client node to create a Client Cache. To add a client node, please refer to the Add Client Node section.

Important

You cannot create a Client Cache on Pub/Sub Messaging and Distributed Lucene with Persistence store.

Using the NCache Management Center

  • Launch the NCache Management Center by browsing to http://localhost:8251 or <server-ip>:9801 on Windows and Linux.

  • In the left navigation bar, click on Clustered Caches to which the Client Cache will be added. Against the Cache Name, click on View Details.

Create Client Cache

  • This opens the detailed configuration page for the cache.

  • In the Client Cache tab, click on the New button.

Create new Client Cache

  • At this point, the New Client Cache page opens.

  • Specify the Client Cache name and synchronization mode. Click Next.

Enter Client Cache Name

  • Next, you can either create a Regular or a Full-Data Client Cache.

Create a Regular Client Cache

To create a Regular Client Cache, follow the steps mentioned below.

  • Specify the type as Regular, choose the Maximum Size and Isolation Level for the Client Cache. The InProc cache lives inside the application process, whereas the OutProc cache lives in a separate service process. Click Next.

Regular Client Cache

  • In the Advanced Options dialog box, you can configure the following:

    • You can change the Eviction Policy and Eviction Percentage; items will be evicted from the cache using the selected policy and percentage value, if eviction is enabled.

    • You can change the Clean Interval value. Its default value is 15 sec.

    • You can make the cache start automatically after a service restart by selecting the checkbox "Auto start this cache on service startup".

Regular Client Cache

  • Click Finish.

Once completed, a Regular Client Cache will be created, and you will get a success notification.

Create a Full-Data Client Cache

To create a Full-Data Client Cache, follow the steps mentioned below.

Important

The Full-Data Client Cache cannot be created while the clustered cache is running.

  • To create a Full-Data Client Cache, select the type as Full-Data, choose the Maximum Size and Isolation Level. Click Next.

Full-Data Client Cache

Note

The reference data types cannot be added on a running clustered cache.

  • Add the Reference Data Types to configure the desired reference data types for your Full-Data Client Cache by clicking the Browse button. You cannot create a Full-Data Client Cache without configuring atleast one reference data type.

Full-Data Client Cache

  • The selected data types will appear in the Select Datatypes section in the same order you add them. You can also change the order of these types through the Move Up and Move Down buttons. This order will define the Eviction Priority for them, i.e., the data type added at the end will be evicted first.

  • You can also remove the selected reference data types through the Remove Selected Datatypes button.

Important

Strict Local Reads and Strict Query Enforcement only apply to reference data types that are configured in the Full-Data Client Cache.

  • In the case of queries, these are executed on the Client Cache first, and will fall back to the clustered cache only if the data is partially loaded in the Client Cache for configured reference data types. However, if you want queries to not fallback to the clustered cache, enable the checkbox "Throw an exception when querying a partially loaded dataset in the client cache, with no fallback to the clustered cache." With this option enabled, the query will not fallback to the clustered cache and will instead fail, throwing the exception: "Unable to execute query on client cache as the type '{queryFQN}' is partially loaded.", thus allowing for Strict Query Enforcment.

  • By default, all read operations check the Client Cache (L1) first, and if the data isn't found, they fall back to the Clustered Cache (L2). However, if you want to avoid this fallback and ensure reads are served strictly from the local cache, you can use the Strict Local Reads feature. With this enabled, any key not found in the Client Cache (L1) results in a cache miss, and no request is made to the Clustered Cache (L2). For this behavior, select the "Return a cache miss for any key not found in the client cache, with no fallback to the clustered cache" checkbox.

Important

If neither checkbox is selected and the data is only partially loaded, the search will fall back to the clustered cache.

Enable SQL Queries on Full-Data Client Cache

  • Click Next.

  • In the Advanced Options dialog box, you can configure the following:

    • You can change the Eviction Policy and Eviction Percentage; items will be evicted from the cache using the selected policy and percentage value.

    • You can configure the Data Reload Threshold. This specifies the percentage of the total cache size at which the evicted data should be reloaded from clustered cache into Client Cache.

    • You can make the cache start automatically after a service restart by selecting the checkbox "Auto start this cache on service startup".

Client Cache Web Advanced

  • Click Finish.

  • This will prompt a success notification and the Client Cache tab will now show options to configure Client Cache settings.

Important

If you make any configuration changes to the Full-Data Client Cache, you must restart the Client Cache.

Using Command Line Tools

You can also create the Client Cache using the PowerShell cmdlets. The following are the PowerShell cmdlets to create the Regular and Full-Data Client Cache respectively.

Regular Client Cache

The New-ClientCache tool enables the user to create a new Client Cache.

This command creates a Regular Client Cache named demoClientCache on client node 20.200.20.12 for an already registered clustered cache on server 20.200.20.11.

Note

If the Type parameter is not specified, a Regular Client Cache will be created by default.

  • Windows
  • Linux
New-ClientCache -CacheName demoCache -ClientCacheName demoClientCache -Type Regular -Server 20.200.20.11 -ClientNode 20.200.20.12 -Path C:\config.xml
new-clientcache -cachename demoCache -clientcachename demoClientCache -type Regular -server 20.200.20.11 -clientnode 20.200.20.12 -path C:\config.xml

Full-Data Client Cache

This command creates a Full-Data Client Cache named demoClientCache on the client node 20.200.20.12, linked to a clustered cache hosted on the server 20.200.20.11. The FailQueryOnPartialDataset switch parameter enforces Strict Query Enforcement and throws an exception if a query is executed on a partially loaded dataset, with no fallback to the clustered cache. The DisableL2FallbackOnMiss switch parameter enforces Strict Local Reads and returns a cache miss for any key not found in the client cache, without attempting to retrieve it from the clustered cache.

  • Windows
  • Linux
New-ClientCache -CacheName demoCache -ClientCacheName demoClientCache -Type FullData -Server 20.200.20.11 -Size 1024 -ClientNode 20.200.20.12 -Optimistic -FailQueryOnPartialDataset -DisableL2FallbackOnMiss
new-clientcache -cachename demoCache -clientcachecame demoClientCache -type FullData -server 20.200.20.11 -size 1024 -clientnode 20.200.20.12 -optimistic -failqueryonpartialdataset -disablel2fallbackonmiss

To add the required Reference Data Types in Full-Data Client Cache, execute the following PowerShell cmdlet:

  • Windows
  • Linux
Add-ClientCacheRefDataType -CacheName demoCache -AssemblyPath C:\Data.dll -DataTypes Data.Customer
add-clientcacherefdatatype -cachename demoCache -assemblypath /usr/Data.dll -datatypes Data.Customer
Note

You can change the Client Cache settings/configurations using the Client Cache tab after creating it (where you can configure email alerts, error logging, compression, synchronization, data reload threshold, and more for the Client Cache). You can also choose to View Details for that particular Client Cache from the Local Caches screen.

See Also

Enable Client Cache on Client Nodes
Disable Client Cache on Client Nodes
Remove Client Cache
Management Operations

In This Article
  • Using the NCache Management Center
    • Create a Regular Client Cache
    • Create a Full-Data Client Cache
  • Using Command Line Tools
    • Regular Client Cache
    • Full-Data Client Cache
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top