Skip to content

Conditionally preload data for optional fields #112

@juanca

Description

@juanca

At the moment, I cannot figure out if there is a way to conditionally preload an association given a certain request. At the moment, custom_preload is invoked with the models and the requests associations.

I think it would be beneficial to also have access to the optional fields (are there other possibilities of bottlenecks?) in the custom_preload method to allow custom preloading. At the moment, I am preloading optional fields on every request which has an impact on memory used -- even when it is not necessary for a subset of requests.

Or better yet: a field and an association should provide a preload interface that can be automatically pooled to maximize usage of the preloader and minimize unnecessary memory usage.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions