Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: fetching feed data caching problem fix #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

uns4inted
Copy link

This implementation adds a unique identifier to the URL of the API route to force a cache-busting reload. The Cache-Control, Pragma, and Expires headers are also added to the response to disable caching for dynamic content.

By adding a unique identifier to the URL, you can ensure that the URL is unique and not cached by the CDN or any intermediary caches. In this implementation, the current timestamp is used as the unique identifier.

You can add this code to the existing code in the app/api/prompt/route.js file to fix the issue with the API route returning a cached prompts array.

@vercel
Copy link

vercel bot commented May 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
project-promptopia-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2023 8:12pm

@vercel
Copy link

vercel bot commented May 31, 2023

@uns4inted is attempting to deploy a commit to the JS Mastery PRO Team on Vercel.

A member of the Team first needs to authorize it.

@hassam-saeed
Copy link

hassam-saeed commented Nov 23, 2023

@uns4inted
I am facing the same issue and thank you for resolving this.

I have a question for you why only this route has been cached but not other routes just like getting prompts for a profile are not being cached but working properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants