Skip to content

Commit

Permalink
Update ConditionalRefresh.md (#284)
Browse files Browse the repository at this point in the history
Fixes #283
  • Loading branch information
onionhammer authored Aug 9, 2024
1 parent d8aaf1c commit 517ba88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/ConditionalRefresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ var product = await cache.GetOrSetAsync<Product>(

using var resp = await client.SendAsync(req, ct);

resp.EnsureSuccessStatusCode();

if (resp.StatusCode == HttpStatusCode.NotModified)
{
// NOT MODIFIED -> RETURN STALE VALUE
return ctx.NotModified();
}

resp.EnsureSuccessStatusCode();

// NORMAL RESPONSE: SAVE ETAG + RETURN VALUE
return ctx.Modified(
await resp.Content.ReadFromJsonAsync<Product>(),
Expand Down

0 comments on commit 517ba88

Please sign in to comment.