Giter VIP home page Giter VIP logo

Comments (4)

cam-m avatar cam-m commented on September 25, 2024 1

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.

cam-m avatar cam-m commented on September 25, 2024

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.

aliostad avatar aliostad commented on September 25, 2024

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.

aliostad avatar aliostad commented on September 25, 2024

Any comments?

from cachecow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.