Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created August 14, 2019 16:58
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 debugmodedotnet/05c4e89a110d368a043d142d7a2dbf92 to your computer and use it in GitHub Desktop.
Save debugmodedotnet/05c4e89a110d368a043d142d7a2dbf92 to your computer and use it in GitHub Desktop.
[Route("Data")]
[HttpGet]
public HttpResponseMessage GetData()
{
var data = GetAllTrainings();
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, data);
response.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(20)
};
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment