Comments (2)
Update:
Without using HttpCacheControlPolicy
attribute, the default cache config like the code below also only applied on the first request as "Cache-Control: no-transform, must-revalidate, max-age=600". The subsequent request will be "304 Not Modified" with "Cache-Control: no-cache".
cachingHandler.CacheControlHeaderProvider = (request, cfg) =>
{
return new System.Net.Http.Headers.CacheControlHeaderValue()
{
Private = false,
MustRevalidate = true,
NoTransform = true,
MaxAge = TimeSpan.FromSeconds(600)
};
};
from cachecow.
The behaviour is correct. Cache Header directives are irrelevant for a 304 response since the cache headers must be sent with the original response:
If the status code is 304 (Not Modified), the cache uses the entity- body stored in the cache entry as the entity-body of this outgoing response.
As you can see, there is no mention of headers here. Hope this helps.
In terms of examples outside, sites implement 304 differently. I have seen one that sends cache control and another only ETag. As I said the headers are irrelevant.
from cachecow.
Related Issues (20)
- CacheCow is not caching (.NET 5.0) HOT 2
- RedisCacheStore - Buffer cannot be null HOT 4
- Problems using it in a .NET 5 WebApi project HOT 4
- New builds for .NET 5.0
- Client cached response content unable to read more than once HOT 7
- Microsoft has broken TraceSwitch in .NET Core
- Source code cannot be mapped for released nuget packages HOT 4
- Possibility to update Microsoft.AspNet.WebApi.Client to 5.2.9 HOT 2
- Tests sending HttpRequest is failing
- Question: Assistance with `.net60` WebApi HOT 6
- System.TypeLoadException: Could not load type 'CacheCow.Common.ConfigurationValueProvider' from assembly 'CacheCow.Common, Version=2.11.2.0 HOT 4
- Can PUT or Patch be made to return an ETag HOT 4
- use SqlStore in .net core HOT 2
- 0.6.3 to 2.11.3 Migration - Replacement for IRoutePatternProvider? HOT 2
- Wrong casing in ETag crashes with InvalidOperationException HOT 1
- RobiniaDocs API Explorer
- Support HttpClientFactory HOT 3
- Adding support for .NET 8.0 HOT 2
- Exception on Startup HOT 3
- Create an alternative to HttpMessageContent serialisation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachecow.