An object which implements some custom serialization can be serialized and deserialized to different formats, for example to Xml or byte[].
I have run into a problem where when I put to cache, AppFabric runs the IXmlSerializable implementation on a class when I would rather force it to go with binary. AppFabric Caching - What are its serialization and deserialization requirements for an object?
Can I configure this?
(At the moment the workaround is to serialize the object programatically to a byte[] and then send that into the cache, reversing the process on the way out).
In the MSDN documentation it says we could implement IDataCacheObjectSerializer to achieve this goal. You can read about it here: http://msdn.microsoft.com/en-us/library/windowsazure/hh552969.aspx
Afer that, you can set the custom serializer to the DataCacheFactory:
Hope this helps.