Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

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
@mansueli mansueli requested a review from grdsdev June 23, 2025 15:53
Copy link
Contributor

@itslenny itslenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great overall. I ran tests against production purging individual objects and folders with 100s of objects and both are working well.

The folder detection is wrong (see other comment) so I get "object not found" for each folder currently, but after that's fixed this should work as expected

@grdsdev grdsdev requested a review from mandarini August 6, 2025 18:12
Copy link

github-actions bot commented Aug 29, 2025

🚀 Preview Release Status

false


Last updated: 2025-08-29T15:38:40Z

@mandarini mandarini requested a review from itslenny September 4, 2025 14:14
Copy link
Contributor

@mandarini mandarini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @itslenny what do you think? I think your comments were addressed!

@mandarini
Copy link
Contributor

Moved here: supabase/supabase-js#1742 @itslenny please can you take a last look at that PR?

@mandarini mandarini closed this Oct 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants