R

Ravina • 3.96K Points
Extraordinary

Q. How can you create dependencies that are only evaluated once per request in FastAPI?

  • (A) use_cache=True in Depends
  • (B) singleton=True
  • (C) cache=True
  • (D) shared=True
  • Correct Answer - Option(A)
  • Views: 9
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
`Depends(..., use_cache=True)` ensures the dependency is called once per request.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.