Encode unicode values before saving them to cache

Since I'm using spanish strings, an UnicodeEncondeError exception was being thrown when saving values to cache.