Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created February 20, 2015 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/475368f2822e16021831 to your computer and use it in GitHub Desktop.
Save abhirockzz/475368f2822e16021831 to your computer and use it in GitHub Desktop.
Create a CacheControl instance manually
@Path("/testcache")
public class RESTfulResource {
@GET
@Produces("text/plain")
public Response find(){
CacheControl cc = new CacheControl();
cc.setMaxAge(20);
return Response.ok(UUID.randomUUID().toString()).cacheControl(cc).build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment