codejump

Dependency Graphs & Reuse

Preview — 3 of 10 questions

Two route parameters depend on the same get_config callable. With default settings, how many times is it normally run within one request?

AOnce for the entire server lifetime
BNever, because duplicate dependencies cancel
COnce; its result is reused for that request
DTwice; each parameter always calls it

Two separate HTTP requests use the same cached dependency. What is the normal cache boundary?

AOnly failed requests run the dependency again
BEach request gets its own dependency resolution
CThe first request's value is reused forever
DThe value is stored in the browser cookie

What does Depends(get_nonce, use_cache=False) request?

ACall get_nonce again at that dependency site within the request
BDisable the browser's HTTP cache
CPersist a nonce for all future requests
DMake the route synchronous

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.