Skip to content

Advice on preventing race conditions caused by multiple calls to the same endpoint made simultaneously (using Redis)? #241

@brianjenkins94

Description

@brianjenkins94

I have a somewhat long-running route that gets paginated data from a third party and uses apicache to cache the result of it. After adding Redis, I've noticed that I don't reliably get back the full dataset from the cache.

It's as if the data that's being cached is being streamed to the database, and the call that gets there second sees that there's one page of data in the cache and uses that as if it were the full response.

I'm working on a minimal sample, but wanted to know if this sounded plausible.

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