Current versus Expected behavior We are facing an issue where our Astro project, which is managed with MongoDB, does not use the latest MongoDB data after a redeploy. Specifically, when we make updates to MongoDB via Payload CMS, the new build process is triggered successfully using a vercel build trigger hook, but the deployment still uses outdated MongoDB data instead of the latest changes.
Expected behavior: The redeploy process should use the most recent MongoDB data during the build and deployment process. Current behavior: The deployment uses cached or outdated MongoDB data, even though the build completes successfully.
Code, configuration, and steps that reproduce this issue
- Our project is built with Astro and uses MongoDB for database management.
- Payload CMS is integrated to manage and update the MongoDB data.
- We have set up a hook in Payload CMS to trigger the build process whenever a database update is made.
- The build completes successfully, but when deployed, the application does not reflect the updated MongoDB data. Instead, it shows the previous data.
Steps to reproduce:
- Update data in Payload CMS.
- Trigger a build process using the Payload CMS hook.
- Redeploy the Astro project.
- Observe that the deployed version does not reflect the updated MongoDB data.
Project information (URL, framework, environment, project settings)
- Framework: Astro
- Database: MongoDB, managed via Payload CMS
- Hosting Environment: Vercel (with Astro Vercel adapter)
- Project Behavior: Static build with hooks triggering builds when MongoDB data is updated.
- CMS Integration: Payload CMS to update MongoDB content.
We believe this issue may be related to caching during the build process or how static builds are generated in Astro. How can we ensure the deployment reflects the most recent MongoDB data?