use memcache flag to implement serialize/unserialize on demand

the final design