Giter Club home page Giter Club logo

Comments (4)

legoheld avatar legoheld commented on July 17, 2024 2

Funny I just made a refactoring in the FliptProvider where I made a wrapper CacheProvider that could be used with any other providers.

from php-sdk.

tcarrio avatar tcarrio commented on July 17, 2024 1

This is likely a larger discussion for the OpenFeature specification. The SDK adheres to the spec and there is no formal caching definition.

Likely the best way to handle this though, in my opinion, is this can be done by decorating an existing provider with a cache proxy provider. All of the uncached interactions would pass through but otherwise the cache would return early.

Many flagging systems have some form of telemetry or analytics that provide business value around flag evaluations. Caching is something that directly hijacks the providers logic, thus having unintended impact to those analytics. For this reason I don't believe any language with an OpenFeature SDK provides this officially as part of the client

from php-sdk.

beeme1mr avatar beeme1mr commented on July 17, 2024

We've talked about this in the past and decided that caching should be a provider concern. It may be possible to create a caching provider that essentially wraps a provider to enable a consistent caching experience.

from php-sdk.

tcarrio avatar tcarrio commented on July 17, 2024

That provider could definitely be reused, but provider developers and SDK consumers need to know the trade-offs. If you are caching the response such that the underlying provider is not called at all, you are missing impressions data, which in many cases is used by businesses to understand the performance of the features behind the flags.

If you want to introduce it to the contrib or publish it as a general package that would work. Please do include the caveats though. Many underlying providers can support caching out of the box while still providing meaningful analytics around the usage, but a pattern like the CacheProvider will act as if no flag evaluation occurred.

That's primarily the reason that this is not technically supported in the specification- most vendors did not want a generalized caching mechanism like this. But consumers can decide on that trade-off themselves 🙂

from php-sdk.

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.