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

useReadContract not observing access-control-max-age response header #4376

Closed
1 task done
studiov-dev opened this issue Nov 4, 2024 · 1 comment
Closed
1 task done
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@studiov-dev
Copy link

Check existing issues

Describe the bug

I'm using useReadContract with { query: { refetchInterval: 250 } }.

With every refresh, the browser sends an OPTIONS preflight request. The RPC response headers includes access-control-max-age: 600 .

I would expect that another OPTIONS preflight request would be sent only after 600 seconds.

For a dapp that relies on fast refetches, sending preflight requests unnecessarily hurts performance.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

What Wagmi package(s) are you using?

wagmi

Wagmi Package(s) Version(s)

wagmi@2.12.25

Viem Version

viem@2.21.35

TypeScript Version

typescript@5

Anything else?

No response

@tmm tmm added the Needs Reproduction Misc: Needs Reproduction label Nov 4, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

Hello @studiov-dev.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants