public static long setMaxAge(HttpResponse response, int maxAge) {
        List<Directive> directives = new ArrayList<>();
        directives.add(new Directive("max-age", maxAge));
        response.setField(HttpField.CACHE_CONTROL, directives);
        return maxAge;
    }
public static long setMaxAge ( HttpResponse response , int maxAge ) { List < Directive > directives = new ArrayList < > ( ) ; directives . add ( new Directive ( "max-age" , maxAge ) ) ; response . setField ( HttpField . CACHE_CONTROL , directives ) ; return maxAge ; }
Sets the cache control header in the given response.

@param response the response
@param maxAge the max age
@return the value set