optimize the to_cache case by not doing another get from memcached


Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
add enable static build option

Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>