📝 Cache OpenAPI views schema generation (#1398)
Currently, our OpenAPI views are really slow, because they recompute the schema on each request. Which is a bad thing if this schema is publicly available and has a lot of traffic.
Example:
django-modern-rest/dmr/openapi/views/json.py
Lines 28 to 30 in 06626f9
Proposal: we need to cache the schema generation. Not the view itself, because it can be cached by the user via a decorator. This might go to the docs as an example.
@cachedproperty seems like the best solution here.#feature #good_first_issue #help_wanted #openapi #opensource_september #django_modern_rest
sent via relator