Skip to content

Question: Caching API two-pass use case? #912

Closed
@johnnyshields

Description

@johnnyshields

Caching API looks really awesome, seems like it will bring big performance gains in my app which has many heavy objects.

One question, is it possible to do two-pass implementation something like:

  1. Query DB for only object ID and updated_at (lightweight query)
  2. Send ID + timestamp list for serializer, serializer readies the objects which it has cached and returns the list of only those IDs which are not cached
  3. Query the DB again for the full objects with ID list from step 2 which aren't cached (heavy query)
  4. Serializer outputs full set objects from steps 2 (cached) and 3 (heavy query)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions