-->

Alachisoft Ncache configuration issues

2019-06-01 18:29发布

问题:

I'm new to NCache from Alachisoft. I`m trying to fix the Viewstate very large variable content issue. I have installed and configured NCache Enterprise Edition 4.4.0 (x64) on my server.

Changes to web.config and app.browser were done as per instructions:

http://www.alachisoft.com/resources/articles/asp-net-performance-view-state-caching.html

and

http://www.alachisoft.com/ncache/demos/demo-ncache-five-steps-getting-started.html

I have successfully created and tested with the "stress test tool" a Local Cache and a clustered Cache called "myCache", one at a time, but without the intended results when checking the Viewstate variable.

I am connecting from a client machine, to the server machine where I have installed and configured NCache. I can see the "myCache" statistics numbers change, but the ViewState variable content is still present on the webpages source code and is very big.

Expected result:

  • ViewState variable content should be reduced to a token.

Environment on server:

  • OS Windows Server 2008 R2 Standard
  • NCache Enterprise Edition 4.4.0 (x64)
  • IIS 7

What else should I check because I believe I have followed all recommended steps for this to work?

Thank you in advance

回答1:

Article you followed seems a bit old. A flag enableMinification is missing from <ncContentOptimization> configuration section. Use the following instead:

  <ncContentOptimization>
    <settings viewstateThreshold="12"
              enableViewstateCaching="true"
              enableTrace="false"
              enableMinification="true"
              groupedViewStateWithSessions="false"
              maxViewStatesPerSession="3" >
      <cacheSettings cacheName="myCache">
        <expiration type="Absolute"
                    duration="1" />
      </cacheSettings>
    </settings>
  </ncContentOptimization>

Make sure cacheName specified in cacheSetting attribute ('myCache' in above case) is running and accessible from application server. By default 'myCache' is a local cache created with NCache installation.

If NCache Server is installed on a separate machine and remote client is installed on application server(as guided in NCache getting started video), make sure cache is running and remote client is added as client node with cache; using NCache Manager. Also in such case cache must be a clustered cache and recommended to have name different than 'myCache' (since remote client has its own local cache named 'myCache'). Specify this cache's name in <ncContentOptimization> section.

I hope this helps.