Extend API with GET evaluation request
What are your thoughts on extending the existing evaluation API with functionally equivalent (to POSTs) GET requests (e.g. GET /evaluation and GET /evaluation/batch)?
Several pros could be observed from general perspective (like idempotency of evaluate), but the main actual reason I'm asking is that my client feature flag request is time critical, and:
-
is always not a simple request from CORS perspective, so a preflight request is always spawned (and it is quite important for us to have an option to keep our services on different hosts for some organisational purposes);POST /evaluation/batch ... ... Content-Type: application/json ... - there is no option to preload the request (by inlining it in the resulting client's HTML);
- GET request is more straightforward from cache control perspective (e.g. when your application shares the same feature flags across different "pages").
(at the moment we address these drawbacks at the infrastructure level: edges/lambdas, reverse proxies, etc.)
Cons are obvious I guess — URL length limitations. Any other?
Hm, well I was a little biased by our Flagr use case: we use batch evaluation mostly in terms of "flags' batch" (one entity context, many flags, selected by tags). But POST /evaluation/batch could have another semantics — many entity context, many flags. And that would be non-trivial to map onto query parameters (yet not impossible, several evaluation entities could be passed as several "JSON-encoded" query parameters, e.g. evalEntity='{"entityID":"a1234","entityType":"report","entityContext":{"hello":"world"}}'&evalEntity='{"entityID":"a5678","entityType":"troper","entityContext":{"hello":"world"}}'). So still interested in your thoughts
that looks nice, do you want to create a PR for it? GET's query has a length limit like 2000 characters, maybe that's enough for most cases.
yep, i'll make it
hey, @nothing0012, could you take a look the proposed api changes?
Stale issue message
@nothing0012 @marceloboeira hi! what do you think about this ?
Stale issue message
@nothing0012 hi! Can you check the PR?