Skip to content

feat(storage): expose purgeCache - #1742

Closed
mandarini wants to merge 1 commit into
masterfrom
feat/expose-purgeCache
Closed

mandarini wants to merge 1 commit into
masterfrom
feat/expose-purgeCache

Conversation

@mandarini

@mandarini mandarini commented Oct 8, 2025 •

Copy link
Copy Markdown
Contributor

Authored by @mansueli
Moved from here: supabase/storage-js#229

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')

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.455% (+13.0%) from 82.5%
when pulling c33f0ac on feat/expose-purgeCache
into 2d0bd77 on master.

@mandarini mandarini added the storage-js Related to the storage-js library. label Oct 13, 2025
@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

This PR has been marked as stale because it has not had activity for 90 days.
It will be closed in 14 days if no further activity occurs.

Please rebase and update if this is still needed.

@mandarini

Copy link
Copy Markdown
Contributor Author

Closing because outdated, and more changes than needed. Will open new PR and mention this one.

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

Labels

storage-js Related to the storage-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants