Purge cache via API works on localhost, but not on Vercel use NextJs

I build a nextjs API to purge Cloudflare cache by URL, and both localhost & Vercel return successful results like the below:

errors : [] messages : [] result : {id: "eba3aecbc392df911866cd33362df62e"} id : "eba3aecbc392df911866cd33362df62e" success : true

but the URL always returns a 304 status code if I purge the cache on Vercel.
the same operation on my localhost, accessing the URL will return a 200 status code.

Below is my nextjs code to purge URL cache:

api result:

304 status code (click purge on Vercel page and refresh the URL always get 304 code)
&
200 status code (only click purge on my localhost and refresh the URL will get 200 code)

ss 2024-04-05 at 8.23.27 AM

There’s no error on Vercel’s log, and the purge API result looks fine.

I’ve debugged this for a few days, but can’t find a solution, please help

I do notice that the id in the API results from localhost & Vercel is different, e.g. localhost is

errors : [] messages : [] result : {id: "eba3aecbc392df911866cd33362df62e"}  success : true

Vercel is:

success: true, errors: [], messages: [], result: { id: '155c21b901dfb586e08f2e439a18057c' }

Does anyone know what the id means?

the id in the response is your zone id. So your localhost is purging a different zone from vercel.