diff --git a/docs/create_model.md b/docs/create_model.md index a169780e4caa7fea08aa935fc70f67ddf4afc6ae..2dfe42d86c57a99eff68a99f790a26f2b6f26ffe 100644 --- a/docs/create_model.md +++ b/docs/create_model.md @@ -211,6 +211,10 @@ In the following example, besides the urls `/members/` and `/members/<pk>/`, two <Model>._meta.nested_fields=["skills"] ``` +### Improving Performance + +On certain endpoints, you may find that you only need a subset of fields on a model, and serializing them all is expensive (e.g. if I only need the `name` and `id` of each group chat, then why serialize all of their members?). To optimise the fields serialized, you can pass a custom header in the request, `Accept-Shape`, with a `list` value of desired fields e.g. `['@id', 'name']` + ## Filter Backends To achieve federation, DjangoLDP includes links to objects from federated servers and stores these as local objects (see 1.0 - Models). In some situations, you will want to exclude these from the queryset of a custom view