Binary encoder for better performance
Now headers and body are encoded in their own binary format before storing in the cache.
This makes it faster and safer to read/write data from the cache.
Also, exception handling has been added when data from the cache is corrupted.