Last active
October 29, 2021 00:41
-
-
Save MahdiKarimipour/92aad205998a734bd8a2259c2d33c1c4 to your computer and use it in GitHub Desktop.
Asp.NET Response Caching at the End Point Level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet("product")] | |
[MapToApiVersion("1")] | |
[ResponseCache(VaryByQueryKeys = new[] { "field", "category" }, Duration = 10 * 60)] | |
public async Task<ActionResult<IEnumerable<ProductViewModel>>> GetProducts( | |
[FromQuery] string field, | |
[FromQuery] string category) | |
{ | |
return Ok(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment