Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

AR::Relation's with eager loading cache_key's #1

Description

@swalkinshaw

Came across this gem from a Rails issue and had a similar problem I was going to solve. Thought it might be useful to include the solution in this gem as well.

We know that using includes to eager load associations is a good way to avoid N+1 queries. And obviously using fragment caching is good as well but they don't place nicely together. When fragment caching a relation that includes associations, they will all get loaded in the query to determine the cache key. In my opinion, the included associations should be discarded in this case.

If you're interested in this feature I could give it a go.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions