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

[App Router] Data Fetching caching strategies in headstartwp.config.js #796

Closed
1 task done
nicholasio opened this issue Jun 28, 2024 · 1 comment
Closed
1 task done

Comments

@nicholasio
Copy link
Member

Is your enhancement related to a problem? Please describe.

#383 Allows for each query function to specify its own caching strategy. This issue is for providing a way to configure the cache strategy globally in headstartwp.config.js

 fetch: {
   headers: ({fetchStrategy}) => {
        if (fetchStrategy.getEndpoint() === '/wp-json/headless-wp/v1/app') {
           return {
              cache: 'force-cache',
              next: {
                 revalidate: 5 * 60,
              }
           }
        }
        return {};
   }
 }

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nicholasio
Copy link
Member Author

I've tought about this and I don't think it makes sense to do this and we can always revisit this later

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

No branches or pull requests

1 participant