code: @Override
      public Result call(Cached configuration, RequestContext context) throws Exception {
          // Can we use the Cached version ?
          boolean nocache =
                  HeaderNames.NOCACHE_VALUE.equalsIgnoreCase(context.context().header(HeaderNames.CACHE_CONTROL));
  
          String key;
          if (Strings.isNullOrEmpty(configuration.key())) {
              key = context.request().uri();
          } else {
              key = configuration.key();
          }
  
          Result result = null;
          if (!nocache) {
              result = (Result) cache.get(key);
          }
  
          if (result == null) {
              result = context.proceed();
          } else {
              LOGGER.info("Returning cached result for {} (key:{})",
                      context.request().uri(), key);
              return result;
          }
  
          Duration duration;
          if (configuration.duration() == 0) {
              // Eternity == 1 year.
              duration = Duration.standardDays(365);
          } else {
              duration = Duration.standardSeconds(configuration.duration());
          }
  
  
          cache.set(key, result, duration);
          LoggerFactory.getLogger(this.getClass()).info("Caching result of {} for {} seconds (key:{})",
                  context.request().uri(), configuration.duration(), key);
  
          return result;
      }
docs: Intercepts a @Cached action method.
  If the result of the action is cached, returned it immediately without having actually invoked the action method.
  In this case, the interception chain is cut.
  <p>
  If the result is not yet cached, the interception chain continues, and the result is cached to be used during
  the next invocation.
  
  @param configuration the interception configuration
  @param context       the interception context
  @return the result.
  @throws Exception something bad happened