fix: py3 reading cache created by py2 error
make FileCache::encode method static
FileCache: fix wrong encoding for py3