• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

General Cache Configuration Settings

Important

In case you want to update any cache settings please refer to the Update Cache Config section to follow the set of steps.

Cache Size

Through this configuration option, you can specify an upper limit on the size of the cache in MB. The number of items in the cache are limited by maximum size of the cache and amount of free system memory (virtual or physical). If some eviction policy is specified, whenever total data size in cache reaches maximum size items are removed from the cache as per eviction policy.

Using NCache Web Manager

  • Launch NCache Web Manager by browsing to http://localhost:8251 (Windows) or <server-ip>:8251 (Windows + Linux).

  • In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache server to start. Against the cache name, click on View Details.

View Cache Details

  • This opens up the detailed configuration page for the cache.

  • In the Overview tab, click on the Edit Cache Settings NCache Web Manager button.

  • Change the Max Cache Size which is in MBs.

NCache Web Manager Overview Cache Size

  • Click on Save Cache Settings NCache Web to save the cache configuration.

Manually Editing NCache Configuration

You can specify the Cache Size through config.ncconf file located at %NCHOME%\config. %NCHOME% is NCache install directory. In config.ncconf of EACH server specify the <storage> tag under the <cache-settings> tag:

<cache-config>
 <cache-settings ...>
    ...
    <storage type="heap" cache-size="1024mb"/>
    ...
 </cache-settings>
</cache-config>

InProc/OutProc for Local Cache

You can specify InProc or OutProc value for local cache.

Using NCache Web Manager

  • Launch NCache Web Manager by browsing to http://localhost:8251 (Windows) or <server-ip>:8251 (Windows + Linux).

  • In the left navigation bar, click on Local Caches.

Important

Make sure the cache you want to configure is stopped.

  • Against the cache name, click on View Details.

View Details Local Cache Web

  • This opens up the detailed configuration page for the cache. Go to the Main tab.

  • Select the Isolation Level for the cache.

Isolation Level NCache Web

  • Click on Save Changes to apply these configurations to cache.

Manually Editing NCache Configuration

For more detail please refer to the Isolation levels section.

In config.ncconf, you can specify the attribute value of inproc as true (for InProc) or false (for OutProc).

InProc:

<cache-config cache-name="demoCache">
  <cache-settings inproc="True">
    ...
  </cache-settings>
</cache-config>

OutProc:

<cache-config cache-name="demoCache">
  <cache-settings inproc="False">
    ...
  </cache-settings>
</cache-config>

Configure Serialization Format

Note

It is recommended that you use JSON serialization if you are using ASP.NET 5.0 and above. For more details click here.

By default, NCache uses the Binary Format. In order to enable JSON serialization on your cache, follow the steps below.

Note

JSON serialization is available in NCache Enterprise and Professional editions.

Note
  • You cannot JSON serialize an InProc cache because by default the data format of an inproc cache is object.
  • It is recommended that you use JSON serialization if you are using ASP.NET 5.0 and above. For more details click here.

Using NCache Web Manager

  • Launch NCache Web Manager by browsing to http://localhost:8251 (Windows) or <server-ip>:8251 (Windows + Linux).

  • In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to configure.

Important

Make sure the cache is stopped before proceeding.

  • Against the cache name, click on View Details.

View Details Cache

  • This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Cluster Settings in the left bar.

  • Change the Serialization to either Binary or JSON.

Serialization

  • Click on Save Changes to apply this configuration to the cache.

  • Start the cache to resume operations.

Manually Editing NCache Configuration

You can also specify the cache serialization format through config.ncconf.

<cache-config ...>
    <cache-settings inproc="False" last-modified="" auto-start="False" data-format="Serialized" serialization="Json">
</cache-config>

See Also

Configure Caches
Configure Clients
Management Operations
Cache Cluster Settings

Back to top Copyright © 2017 Alachisoft