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

Suppression logic on the front end for too often page refresh in Turbo 8 #544

Closed
ArturT opened this issue Dec 14, 2023 · 2 comments
Closed

Comments

@ArturT
Copy link

ArturT commented Dec 14, 2023

I've been testing and using Turbo 8 with morphing. I noticed that when there are a lot of updates for the active record model in a short amount of time, then sometimes the page gets a few page refreshes per second via Turbo Streams. This causes the browser to cancel the previous http request and start a new one. This shows up as a 499 http status code in Heroku logs (H27 - Client Request Interrupted).

cancled requests 2

I already suppressed broadcasting model updates on the Rails app backend by removing touch: true on associated models. But for high traffic applications, when the active record model is often updated by parallel requests, then regular suppression logic does not help #499

Is there a way to suppress page refresh logic on the front end? For example, tell Turbo to refresh the page at most once every 2 seconds.

Any recommendation on what could be done to suppress page refreshes? Thank you.

@brunoprietog
Copy link
Contributor

brunoprietog commented Dec 15, 2023

I've opened hotwired/turbo#1099 to address this

@brunoprietog
Copy link
Contributor

I think we can close this. The proposal was merged

@ArturT ArturT closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants