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

chore(frontend): Optimize requests made to the backend #6168

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

amanape
Copy link
Member

@amanape amanape commented Jan 9, 2025

End-user friendly description of the problem this fixes or functionality that this introduces
A request would be made every time a component that contained a query hook were to mount (e.g., toggling the settings modal)

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions
Change the default staleTime to 5 minutes and gcTime (how long data remains in cache) for 15 minutes. As a result, this will no longer make frequent calls to the API.

NOTE!

This is set to the global query client which means every query will now have the same staleTime value. If there would be a query we want to make more frequently, we will have to explicitly set it on that query's options.


Link of any specific issues this addresses


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:f6677c8-nikolaik   --name openhands-app-f6677c8   docker.all-hands.dev/all-hands-ai/openhands:f6677c8

@amanape amanape self-assigned this Jan 9, 2025
@amanape amanape enabled auto-merge (squash) January 9, 2025 14:47
@amanape amanape merged commit 3eae2e2 into main Jan 9, 2025
16 checks passed
@amanape amanape deleted the ALL-1024/optimize-fetch branch January 9, 2025 15:00
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.

2 participants