Skip to content

Inertia.js 3.9 can pause polling when the tab is in the background

A new background option on usePoll() and router.poll() stops requests firing in hidden tabs, with a pause mode that catches up the moment the tab is visible again.

Source: Inertia.js

Inertia.js 3.9 adds a background option to usePoll() and router.poll(), giving polling three explicit modes in hidden tabs: throttle, the default, keeps the old behaviour of running every tenth interval; pause stops polling entirely until the tab is visible again; continue keeps polling at the full interval regardless. The old keepAlive option still works but is deprecated in favour of background: 'continue'.

With pause, if a poll was due while the tab was hidden, Inertia fires it as soon as the tab becomes visible rather than waiting out the rest of the interval. The release also tags the navigate event with a type of initial, visit or history, flushes the prefetch cache on history clear so a logged-out user can’t see a cached protected page via back button, and fixes a couple of back-navigation bugs where pending updates could overwrite a restored page.

import { usePoll } from '@inertiajs/vue3'

usePoll(5000, {}, { background: 'pause' })

Why it matters: any dashboard or live-updating view built with Inertia’s polling has been sending requests the whole time a user had the tab open in the background, just throttled. pause turns that off completely, which is a direct cut in server load and in Laravel billing tied to request count, for the cost of one option.

Share

Related reading

More from The Wire

All briefs

GitHub Copilot retires six AI models today

Gemini 3.7 Flash, GPT-5.5, GPT-5.4, GPT-5.4 mini, GPT-5 mini and Grok 4.5 stop working across Copilot Chat, inline edits, agent mode and completions from today.

via GitHub