implemented better memcache and fixed header stale cache