---
title: "Implementing RFC-compliant HTTP caching for HttpClient in .NET"
url: https://daily.dev/posts/implementing-rfc-compliant-http-caching-for-httpclient-in-net-ckf4syuwc
source_url: https://www.meziantou.net/implementing-rfc-compliant-http-caching-for-httpclient-in-dotnet.htm
type: article
source: "Meziantou"
published: 2026-03-16T12:17:37.000Z
updated: 2026-03-16T12:18:01.556Z
tags: [".net", "c#", "aspnet"]
reading_time: 5
upvotes: 5
comments: 1
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Implementing RFC-compliant HTTP caching for HttpClient in .NET

**[Meziantou](https://daily.dev/sources/meziantou)** · 5 min read · 5 upvotes · 1 comments

## Summary

HttpClient in .NET lacks built-in HTTP caching, requiring every request to hit the server. The Meziantou.Framework.Http.Caching NuGet package adds RFC 7234 and RFC 8246 compliant caching via a DelegatingHandler. The post covers installation, basic usage, ASP.NET Core dependency injection integration, client cache directives (no-cache, max-stale, only-if-cached), configurable options like response size limits and custom cache predicates, and thread safety including cache stampede prevention.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.meziantou.net/implementing-rfc-compliant-http-caching-for-httpclient-in-dotnet.htm>

## Community discussion

Top comments from developers on daily.dev.

**@ricow** · 0 upvotes

> The C# HttpClient might not have it, but ASP NET Core does. In ASP it's called Response caching and is RFC 9111 compliant. RFC 9111 obsoletes RFC 7234
>
> See: [https://learn.microsoft.com/en-us/aspnet/core/performance/caching/response?view=aspnetcore-10.0](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/response?view=aspnetcore-10.0)
> and [https://www.rfc-editor.org/rfc/rfc9111](https://www.rfc-editor.org/rfc/rfc9111)

## Similar posts on daily.dev

- [How to implement caching in ASP.NET Core minimal APIs](https://daily.dev/posts/how-to-implement-caching-in-asp-net-core-minimal-apis-mexg4z2ck) · InfoWorld · 3 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#), [#aspnet](https://daily.dev/tags/aspnet)

[View this post on daily.dev](https://daily.dev/posts/implementing-rfc-compliant-http-caching-for-httpclient-in-net-ckf4syuwc)
