code: private boolean isFresh(final YokeRequest request) {
          // defaults
          boolean etagMatches = true;
          boolean notModified = true;
  
          // fields
          String modifiedSince = request.getHeader("if-modified-since");
          String noneMatch = request.getHeader("if-none-match");
          String[] noneMatchTokens = null;
          String lastModified = request.response().getHeader("last-modified");
          String etag = request.response().getHeader("etag");
  
          // unconditional request
          if (modifiedSince == null && noneMatch == null) {
              return false;
          }
  
          // parse if-none-match
          if (noneMatch != null) {
              noneMatchTokens = noneMatch.split(" *, *");
          }
  
          // if-none-match
          if (noneMatchTokens != null) {
              etagMatches = false;
              for (String s : noneMatchTokens) {
                  if (etag.equals(s) || "*".equals(noneMatchTokens[0])) {
                      etagMatches = true;
                      break;
                  }
              }
          }
  
          // if-modified-since
          if (modifiedSince != null) {
              try {
                  Date modifiedSinceDate = parse(modifiedSince);
                  Date lastModifiedDate = parse(lastModified);
                  notModified = lastModifiedDate.getTime() <= modifiedSinceDate.getTime();
              } catch (ParseException e) {
                  notModified = false;
              }
          }
  
          return etagMatches && notModified;
      }
docs: Verify if a resource is fresh, fresh means that its cache headers are validated against the local resource and
  etags last-modified headers are still the same.
  
  @param request
  @return {boolean}