this.requestHeaders = requestHeaders;
}
public void execute(@Observes @WriteResponse CachedMethodExecuted executed) {
try {
Cached cached = executed.getCached();
CharArrayWriterResponse charArrayResponse = ProxyTargetInstance.get(response);
ActionCacheEntry entry = actionCache.fetch(new CacheKey(cached,requestHeaders));
HttpServletResponse originalResponse = charArrayResponse.delegate();
entry.copyHeadersTo(originalResponse);
logger.debug("Using cached response for {}", cached.key());
originalResponse.getWriter().write(entry.getResult());
originalResponse.flushBuffer();
} catch (IOException e) {
throw new ResultException(e);
}