@Override
                        public void handle(IAsyncResult<ISignalReadStream<ApiResponse>> result) {
                            if (result.isError()) {
                                chain.throwError(result.getError());
                            } else {
                                ISignalReadStream<ApiResponse> cacheEntry = result.getResult();
                                if (cacheEntry != null) {
                                    context.setConnectorInterceptor(new CacheConnectorInterceptor(cacheEntry));
                                    context.setAttribute(SHOULD_CACHE_ATTR, Boolean.FALSE);
                                    context.setAttribute(CACHED_RESPONSE, cacheEntry.getHead());
                                } else {
                                    context.setAttribute(SHOULD_CACHE_ATTR, Boolean.TRUE);
                                }
                                chain.doApply(request);
                            }
                        }
If the request is cached an {@link IConnectorInterceptor} is set in order to prevent the back-end connection to be established.
Otherwise an empty {@link CachedResponse} will be added to the context, this will be used to cache the response once it has been
received from the back-end API

@see io.apiman.gateway.engine.policies.AbstractMappedPolicy#doApply(io.apiman.gateway.engine.beans.ApiRequest, io.apiman.gateway.engine.policy.IPolicyContext, java.lang.Object, io.apiman.gateway.engine.policy.IPolicyChain)
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/CachingPolicy.java