Automatic Purging based on Mutations

You do not need to handle all purging yourself. For example, if you pass your mutations through the Stellate Edge Cache, we analyze the responses and automatically purge documents containing modified entities.

πŸ“˜

This approach has some edge cases, which you can read more about in Automatic Cache Invalidation via Mutations.

Given a (contrived) mutation that updates a specific launch:

mutation {
    updateLaunch(id: 108, mission_name: "Stellate Edge Cache Expansion") {
        __typename
        id
        name
    }
}

we would see the following response from the SpaceX backend service:

{
    "data": {
        "updateLaunch": {
            "__typename": "Launch",
            "id": "108",
            "mission_name": "Stellate Edge Cache Expansion",
        }
    }
}

Stellate would then analyze the response, see that (in this case) the Launch with ID 108 was modified, and invalidate any cached responses tagged with key:Launch:id:108

Stellate supports multiple ways to invalidate cached responses based on mutations passing through our edge cache infrastructure. We call these Mutation Policies, and you can read more about the currently supported policies on our documentation page about Automatic Cache Invalidation.


Did this page help you?