Professional Documents
Culture Documents
Download Memcached Providers release and unzip it. Download Memcached for win32 from http://jehiah.cz/projects/memcached-win32/ for version 1.2.1 and from http://www.splinedancer.com/memcached-win32/ for version 1.2.4. (This version supports multiple Get method). Create a new ASP.net Web Application Project.
Right mouse click on the references folder in the project and click on Add Reference option. Go to the location where Memcached Providers were unzip and select Enyim.Cache.dll, MemcachedProviders.dll & Log4net.dll. Then click OK to add them to the project. Open Web.config file and add the following section to configSections tag
<section name="cacheProvider" type="MemcachedProviders.Cache.CacheProviderSection, MemcachedProviders" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/> <sectionGroup name="enyim.com"> <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching" /> </sectionGroup> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
This document is provided under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
Add the following section to configure Enyims client to point to Memcached servers
<enyim.com> <memcached> <servers> <!-- put your own server(s) here--> <add address="127.0.0.1" port="11211" /> </servers> <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:00:10" deadTimeout="00:02:00" /> </memcached> </enyim.com>
Add the following section to configure Memcached Cache Provider. keySuffix attribute allows for adding suffix to cache provider keys in order to simulate namespaces.
<cacheProvider defaultProvider="MemcachedCacheProvider"> <providers> <add name="MemcachedCacheProvider" type="MemcachedProviders.Cache.MemcachedCacheProvider, MemcachedProviders" keySuffix="_MySuffix_" defaultExpireTime="2000"/> </providers> </cacheProvider>
Add a new aspx page to the project. Switch to code view and add the following line of code.
using MemcachedProviders.Cache;
This document is provided under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/