Skip to content

feat: expose purgeCache #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: expose purgeCache #229

wants to merge 4 commits into from

Conversation

mansueli
Copy link
Member

What kind of change does this PR introduce?

The goal is to expose the purgeCache operation from the API to the client libraries.

        "/cdn/{bucketName}/{wildcard}": {
            "delete": {
                "summary": "Purge cache for an object",
                "tags": [
                    "object"
                ],
                "parameters": [
                    {
                        "schema": {
                            "type": "string"
                        },
                        "example": "avatars",
                        "in": "path",
                        "name": "bucketName",
                        "required": true
                    },
                    {
                        "schema": {
                            "type": "string"
                        },
                        "example": "folder/cat.png",
                        "in": "path",
                        "name": "*",
                        "required": true
                    },
                    {
                        "schema": {
                            "type": "string"
                        },
                        "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs",
                        "in": "header",
                        "name": "authorization",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Successful response",
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "success"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "4XX": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Error response",
                                    "$ref": "#/components/schemas/def-1"
                                }
                            }
                        }
                    }
                }
            }
        },

What is the current behavior?

There's no support this in the client libraries.

What is the new behavior?

The goal is to allow this to be exposed in the supabase-js client e.g:

storage.from(BUCKET_ID).purgeCache('test.png')

Additional context

Add any other context or screenshots.

@mansueli mansueli changed the title expose purgeCache feat: expose purgeCache Jun 20, 2025
@mansueli mansueli requested a review from itslenny June 20, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant