Modified proxy.c to support caching(NEED DEBUG)