Giter VIP home page Giter VIP logo

Comments (9)

darkweak avatar darkweak commented on June 2, 2024 1

You're right, my bad, I'll fix that too for the next release (I hope to release this week). Thank you for this feedback.

from souin.

darkweak avatar darkweak commented on June 2, 2024

Hello @let4be, thank you for your feedback. Can you send an example to reproduce please ?

from souin.

let4be avatar let4be commented on June 2, 2024

Sorry, I don't have an example.

I was just going through the code and noticed there's no longer a .Revalidate() call in this particular if branch: https://github.com/darkweak/souin/blob/v1.6.40/pkg/middleware/middleware.go#L399

Meaning we will NEVER revalidate with the upstream if response was located in the cache, which is a drastic change introduced in this PR

from souin.

darkweak avatar darkweak commented on June 2, 2024

This if condition is for the fresh cache, it doesn't need to revalidate here unlike the stale cache condition https://github.com/darkweak/souin/blob/v1.6.40/pkg/middleware/middleware.go#L428 which have the Revalidate call https://github.com/darkweak/souin/blob/v1.6.40/pkg/middleware/middleware.go#L451. Maybe I'm missed something in the RFC.

from souin.

let4be avatar let4be commented on June 2, 2024

Revalidation is related to the conditional request, as far as I understood we cannot always know that cached version is fresh if client is using one of conditional requests(https://datatracker.ietf.org/doc/html/rfc7232)

Before this PR there was a .Revalidate() call in this if branch...

from souin.

darkweak avatar darkweak commented on June 2, 2024

@let4be Can you try with that commit a36be95b162f7847590d01a0d5c37a1abd4fd833 and tell me if it's all good now?

from souin.

let4be avatar let4be commented on June 2, 2024

Commented here: a36be95

from souin.

darkweak avatar darkweak commented on June 2, 2024

Fixed in a9569b828220655ca1039216cd02a75a1d67eed2

from souin.

let4be avatar let4be commented on June 2, 2024

Looks better!
I'm still not exactly sure if we update cached headers when remote said NotModified(and headers only) and if we reuse cached body in this case with new headers

from souin.

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.