Create a Cache
NCache Professional edition allows you to create the following caches:
- Partitioned Cache
- Replicated Cache
- Local Cache (meaning a standalone cache)
For other caching topologies, please download and use NCache Enterprise. See more details on edition comparison between NCache Open Source, Professional and Enterprise.
We'll create a Partitioned Cache here.
New-Cache cmdlet enables the user to create a new cache on one or more server nodes.
In Windows PowerShell, execute the following command to create a new partitioned cache named demoCache on server 20.200.20.200, with default configurations.
Warning
Cache with the specified name should not exist on the server; otherwise you get an error message that this cache already exists on this server.
New-Cache -Name demoCache -Server 20.200.20.200 -Size 1024 –Topology Partitioned
You can create a Replicated cache by specifying -Topology Replicated
.
Start Cache
To start the cache, please type the following command in Windows PowerShell:
Start-Cache –Name demoCache
Successful cache creation will be prompted on the screen.
Verify Successful Cache Creation
To verify that you’ve created the cache successfully, please type the following command in Windows PowerShell:
Get-Caches -Detail
This command gives a detailed status of all caches registered on the cache server. You should see that demoCache has a Cluster-size of 1 with IP address of the cache server listed with it. The output also displays the Item Count, which at this stage should be 0.
See Also
Add Local/Remote Clients
Monitor Caches in PerfMon
Use NCache from .NET Application
Use NCache for ASP.NET Sessions
NCache Programmer's Guide
NCache PowerShell Guide