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

fetch options should be passed on fetching #1

Open
Edvinas1122 opened this issue Dec 7, 2023 · 1 comment
Open

fetch options should be passed on fetching #1

Edvinas1122 opened this issue Dec 7, 2023 · 1 comment

Comments

@Edvinas1122
Copy link

consider NextJS fetch

const site_data = await fetchSiteMetadata(
  url,
  { next: { revalidate: 30} }
);

we need to pass caching parameter

could you adjust so that in

const response = await fetch(urlString, {
  signal: controller.signal
  ...options
})

we spread options, and in any sub-fetches also

@fabon-f
Copy link
Owner

fabon-f commented Dec 10, 2023

@Edvinas1122 Thank you for using this package! I published v0.2.0 which supports passing fetch options.

caveats

HTTP requests inside the package probe-image-size which fetch-site-metadata depends on are sent by needle package and therefore we can't pass a options. Perhaps I'll work on this problem in future, by forking probe-image-size or write alternative module by myself.

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

No branches or pull requests

2 participants