Comments (4)
Sorry it dropped off my radar for a bit @aliostad.
I tried to get PUT to return an Etag with a custom CachabilityValidator (I may have that class name spelled wrong here) but I couldn't get the Etag to reach the client for some reason.
I'll leave my use of cache cache cow doing the extra conditional get for now, but thanks for replying :)
from cachecow.
Sorry, but I've just read a bit futher into the http spec and found that:
Responses to the PUT method are not cacheable. If a successful PUT
request passes through a cache that has one or more stored responses
for the effective request URI, those stored responses will be
invalidated (see Section 4.4 of [RFC7234]).
So my question appears to only be valid for PATCH, and probably also pertains to use of the PREFER header which can specify that the full representation is returned on success including an ETag.
From Here:
An example request specifying the "return=representation" preference:
PATCH /item/123 HTTP/1.1
Host: example.org
Content-Type: application/example-patch
Prefer: return=representation
1c1
< ABCDEFGHIJKLMNOPQRSTUVWXYZ
---
> BCDFGHJKLMNPQRSTVWXYZ
An example response containing the resource representation:
HTTP/1.1 200 OK
Content-Location: http://example.org/item/123
Content-Type: text/plain
ETag: "d3b07384d113edec49eaa6238ad5ff00"
BCDFGHJKLMNPQRSTVWXYZ
from cachecow.
Hi @cam-m,
As you said, responses to PUT, PATCH and DELETE are not cacheable although CacheCow does the conditional validation on your behalf using 'if-' headers.
As for the patch with prefer, the case is not widely used and is not supported. Having said that, if the server returns the ETag, CacheCow must allow it flow to the client and if it does not then it is a bug. If that is the case, please open another issue with reproduction instructions.
from cachecow.
Any comments?
from cachecow.
Related Issues (20)
- 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
- 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
- Review dependencies due to security findings
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.