Comments (4)
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.
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.
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.
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)
- Dependency Dashboard
- [CHORE] Deprecate PHP 7.4 support
- [DOCS] Documentation for contributors
- Unit tests: base hooks
- Unit tests: No-op provider default
- Unit tests: client internal flag value type error
- Unit test: client getVersion
- Unit test: No-op client default
- Unit test: No-op client mutators
- Unit tests: StringHelper
- [DOCS] SDK HOT 2
- Hook execution behavior
- Cleanup: Remove commented code on globals
- [BUG] AbstractHook incorrectly defines finally hook method
- [FEATURE] Remove enum package for new native enums
- [FEATURE] Latest test-harness
- Changes to support spec `v0.6.0`, `v0.7.0` compliance
- [DOC] Update readme to follow new template HOT 1
- Drop support for EOL PHP 8.0
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 php-sdk.