Build cache not working in Astro static projects

We have a some projects in CF Pages using the same Astro static generation project. Even the "Build cache" is enable in every project, the build logs says its not beeing used:
2025-06-26T15:22:55.845054Z Using v2 root directory strategy
2025-06-26T15:22:55.87282Z Success: Finished cloning repository files
2025-06-26T15:22:56.58822Z No build output detected to cache. Skipping.
2025-06-26T15:22:56.588828Z No dependencies detected to cache. Skipping.
2025-06-26T15:22:57.563263Z Checking for configuration in a Wrangler configuration file (BETA)
2025-06-26T15:22:57.563916Z
2025-06-26T15:22:57.565578Z Found wrangler.toml file. Reading build configuration...
(...)
2025-06-26T15:25:49.991136Z ✨ Upload complete!
2025-06-26T15:25:52.311179Z Uploading to build output cache
2025-06-26T15:25:52.312274Z Uploading to dependency cache
2025-06-26T15:25:52.316154Z Failed to upload dependencies to build cache. Skipping.
2025-06-26T15:25:52.317851Z Failed to upload build output to build cache. Skipping.
2025-06-26T15:25:57.581078Z Success: Assets published!
2025-06-26T15:26:01.048343Z Success: Your site was deployed!
2025-06-26T15:22:55.845054Z Using v2 root directory strategy
2025-06-26T15:22:55.87282Z Success: Finished cloning repository files
2025-06-26T15:22:56.58822Z No build output detected to cache. Skipping.
2025-06-26T15:22:56.588828Z No dependencies detected to cache. Skipping.
2025-06-26T15:22:57.563263Z Checking for configuration in a Wrangler configuration file (BETA)
2025-06-26T15:22:57.563916Z
2025-06-26T15:22:57.565578Z Found wrangler.toml file. Reading build configuration...
(...)
2025-06-26T15:25:49.991136Z ✨ Upload complete!
2025-06-26T15:25:52.311179Z Uploading to build output cache
2025-06-26T15:25:52.312274Z Uploading to dependency cache
2025-06-26T15:25:52.316154Z Failed to upload dependencies to build cache. Skipping.
2025-06-26T15:25:52.317851Z Failed to upload build output to build cache. Skipping.
2025-06-26T15:25:57.581078Z Success: Assets published!
2025-06-26T15:26:01.048343Z Success: Your site was deployed!
I'm not sure why it cant use Build cache. Our projects need to have some copy and move in folders in prebuild, according to the site/project that is being build. I dont know if it interferes in the build cache or whats happening. What can i do so the build cache can be used?
10 Replies
Walshy
Walshy2mo ago
Seems like it's failing to upload Can you share the deployment ID? ?pages-deployment-id
SuperHelpflare
SuperHelpflare2mo ago
The Pages deployment ID is a unique build identifier. It's the UUID in the browser bar (for example, a URL would be dash.cloudflare.com/ACCOUNT_ID/pages/view/PROJECT/DEPLOYMENT_ID where the deployment ID looks something like a398d794-7322-4c97-96d9-40b5140a8d9b). This ID can help troubleshoot some issues with Pages builds so if you have a failing build make sure you grab that ID for the team to use.
Santho
SanthoOP2mo ago
Sure! 259dfe8c-8073-439e-bafe-0d147ebc4162
Walshy
Walshy2mo ago
Not sure why this isn't surfaced, will raise with the team: Error: No package-lock.json, pnpm-lock.yaml, yarn.lock, or bun.lockb! Not supported
Santho
SanthoOP2mo ago
As i mentioned, our folder structure is a little bit different from Astro usual project. We have a astro/core folder that contains the package.json file, and all the main project. But we also have astro/sites/orderboomscom folder, that is pointed as root for the project because of the wrangler.toml with the site configurations. But inside this folder theres not a package.json initially Just after the copy/move folders that i told about, when we move astro/core to astro/sites/orderboomscom then we run the Astro build command This could be causing the Build cache fail?
Walshy
Walshy2mo ago
I forget where it looks for the file but you have a package.json but do you have a package-lock.json? I think it should look at your configured root
Santho
SanthoOP2mo ago
Yes, i have. But not in the root, initially We needed to change the root folder because the wrangler.toml file for each site. Is there a different way to make the system recognizes the wrangler.toml file that is not initially inside the root folder?
Walshy
Walshy2mo ago
not today and I'm not sure that'll be something changed anytime soon
Santho
SanthoOP2mo ago
Got it. We made a lot of tries to copy wrangler to root and start the build, but CF never recognized it, only when it was already in the root just after the clone To facilitate the maintenance we tried to keep just one package.json to be used in every site project, but as you are saying, this file also need to be in the root folder in the very begning of the build right? @Walshy I'm doing some tests, changed the folders structure and the root folder, but it keep failing to upload build cache. Can you check what is hapenning, please? Here is the deployment ID: 6d695a2f-07c2-43c1-973c-99708825d9f4
บอย
บอย5w ago
ระมัวจะโดนตามกดหามยนะจะ

Did you find this page helpful?