optimize apc/memcache usage

by saving identical permission maps under the same key