enyim/memcached-providers — Issue #4: System.ArgumentException: Keys cannot contain the chars 0x00-0x20 and space.
Author: tlianza
Created: 2011-11-06 05:20:37+00:00
State: open

When using the Memcached output provider, and enabling static file output caching in IIS, I wind up getting a lot of exceptions like this, for simple files that should 404. Ex. bots will request content with bad characters in it, and instead of returning a 404, the server winds up returning a 500.

Any ideas for a good workaround for this? I understand if memcached is limited in the characters it might accept for keys, but it seems to me like perhaps the outputcache provider's "Get" implementation might be better served to return the fact that it doesn't have content for that key, rather than throwing an exception. But, perhaps there are ramifications I'm not considering.

Thanks,
Tom

```
System.ArgumentException: Keys cannot contain the chars 0x00-0x20 and space.
at Enyim.Caching.Memcached.DefaultKeyTransformer.Transform(String key) in d:\Dropbox\repo\EnyimMemcached\Enyim.Caching\Memcached\KeyTransformers\DefaultKeyTransformer.cs:line 22
at Membase.MembaseClient.PerformTryGet(String key, UInt64& cas, Object& value) in d:\Dropbox\repo\EnyimMemcached\Membase\MembaseClient.cs:line 85
at Enyim.Caching.MemcachedClient.TryGet(String key, Object& value) in d:\Dropbox\repo\EnyimMemcached\Enyim.Caching\MemcachedClient.cs:line 132
at Enyim.Caching.MemcachedClient.Get(String key) in d:\Dropbox\repo\EnyimMemcached\Enyim.Caching\MemcachedClient.cs:line 107
at System.Web.Caching.OutputCache.Get(String key)
at System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
```