After payment, pressing Back returns to the order page still showing “Pending payment” until a refresh—is the browser storing the whole page?
Conclusion first: When a user pays and presses Back to return to the order page and it still shows “Pending payment,” in most cases it is not the server querying old data again, but the browser’s back/forward cache (bfcache) restoring the whole-page snapshot from when the user left, together with the UI state, so the page does not send a new request; another part comes from single-page app routing or a state store retaining the old state. Based on common delivery experience in 2026, the diagnostic order is: first check whether pageshow’s persisted is true, then check whether the API is cached by the front end, and only then suspect the data itself. If the order is reversed, it is easy to do rework that ends with “after clearing the cache it is still the same.”
Seeing an old state after going back: first distinguish three sources
bfcache stores the entire page structure and script state; the page is not destroyed, and scroll position, input fields, and timers all stay at the moment of leaving. HTTP cache stores response bytes, but the page still re-executes scripts and re-sends requests. Both look like “not refreshed,” but they are handled in different places.
- Back/forward cache (bfcache): On forward/back navigation, the whole page is restored, the API is not re-requested, and state stays at the moment of leaving.
- Front-end routing and retained state: In a single-page app, components are reused and global state is not cleared, so entering the page reads the previous data.
- HTTP cache and Service Worker: HTML or API responses are cached, so re-entering the page still gets the old response.
A simple way to distinguish them: record event.persisted and the time of leaving in pagehide and pageshow. If it is true, it is a snapshot restore, so you can lock onto bfcache first; if it is false and the state is still old, the problem is in front-end state or response caching.
Why order and approval pages are more sensitive to old state
If a display page is restored, the user at most sees an outdated note; if a transaction page is restored, the user will act on the outdated state: seeing Pending payment and paying again, seeing Pending approval and submitting again, seeing Shipped when it has not actually shipped. The problem is not caching itself, but that actionable buttons are derived from the old state.
So the focus is not “reload the whole page,” but making state-sensitive blocks and button availability return to the server’s current state.
Delivery scenario: a two-day window, when only the front end can be changed, what trade-offs?
A common constraint is tight client budget and launch time, with permission to change only the front end, and the cycle compressed to two or three days. The approach is: in pageshow, when persisted is true, send only one lightweight query for the order status block instead of reloading the whole page; if the time since leaving exceeds the typical range (experience range: 1 to 5 minutes), refresh the whole block; short back-and-forth switching does not disturb the user. The result is that after going back, the state can mostly catch up within one query; the cost is an occasional loading state on weak networks, which needs to be explained to the client before acceptance.
Conversely, a blunt site-wide disabling of back/forward cache often leads to feedback that Back has become slow only a week after acceptance, which actually increases revision rounds. Such trade-offs should be written into the scope statement during requirements confirmation.
Comparing several approaches side by side
These approaches have no absolute advantages or disadvantages; the difference is where the cost is spent. They differ in change scope, experience impact, and the types of restoration they cover. First consider whether the page is transactional or presentational.
- Targeted refresh with pageshow: Front-end changes commonly take half a day to one day (experience range), with little experience impact; it covers only bfcache and cannot handle a single-page app’s own retained state.
- Server-side revalidation: Whether a button is clickable is determined by the server’s current state; commonly one extra request, adding tens to one or two hundred milliseconds (experience range), suitable for payment and approval entry points.
- Page-level freshness marker: Takes about a few hours to half a day to implement (experience range); users who stay a long time may still see old state, so it is suitable as a fallback.
- Site-wide disabling of back/forward cache: Small change and broad coverage; Back necessarily triggers a new request, but the cost is slower forward/back navigation across the site, with an obvious feel on mobile, so it should not be used as a general measure.
In practice, the more common combination is “targeted refresh + server-side revalidation”: leave display pages alone and focus on transaction pages. With only one layer, users may still be exposed when switching tabs back and forth.
Applicable and non-applicable boundaries
To decide whether to handle it, one criterion is enough: will the state on the page directly lead to the next action? If it leads to an action, it needs handling; if it is only for viewing, usually no extra investment is needed.
- Suitable: Order and payment results, approval and ticket details, inventory and quota display, coupon availability status, queue number progress.
- No need: News announcement body text, help documentation, company introduction pages; snapshot restoration is normal browser optimization, and interrupting it artificially lowers the experience.
- Low return: Low-frequency operation pages in internal back offices, where the probability of going back is low; they can be put on a list first and scheduled later.
- Not applicable: Treating “disable back/forward cache” as a general solution to all stale-data problems; it neither covers single-page app state retention nor delivers true data consistency.
FAQ
On mobile, after opening from a chat app, is gesture back the same as browser Back?
Not exactly. Back in an in-app WebView mostly goes through the container’s own history stack, and some environments do not go through snapshot restoration, but they may still retain page state; test on both desktop and mobile.
persisted in pageshow is always false—does that mean there is no back/forward cache?
A common reason is that the page binds an unload event, or the response carries a no-cache header, so the browser actively gives up the snapshot; remove such patterns first and observe again, and do not rush to conclude that the mechanism does not work.
If I set the API response header to no-cache, can that solve old data shown after going back?
Usually not. During snapshot restoration, the page does not send a request at all, so response headers cannot affect this step; what needs handling is page-level state and the availability of actionable buttons.
A user opens two tabs, pays in one, and the other still shows Pending payment—is that the same cause?
It is not the same mechanism. Multiple tabs each hold in-memory state, which cannot be solved by front-end refresh; a more reliable approach is for the server to validate the current state before an action, and to explain the reason clearly in the prompt.
If you do only one thing: add a persisted check and one lightweight status refresh to transaction pages, and return button availability to the server. If budget and schedule allow, then add three regression paths: “place order—go back—act again,” “two open tabs,” and “weak-network gesture back.” Display pages are not recommended to be changed together; drawing clear boundaries is more important than changing more.
-
Detail page images looked fine at launch, but days later customers see broken images—are private bucket signed links expiring?
Date: Nov 23, 2026 Read: 4
-
Order time shows 1970 in the order list but exports correctly to Excel: fix the page first or unify the API unit first?
Date: Nov 22, 2026 Read: 8
-
After the certificate is renewed and replaced, why does the client’s phone still show “not secure”—is the cache not refreshed?
Date: Nov 21, 2026 Read: 12
-
Invoice PDF only flashes when tapped in WeChat, but opens normally in a mobile browser—do we still need to change anything?
Date: Nov 20, 2026 Read: 17
-
Small Excel Exports Open but a Large One with Tens of Thousands of Rows Says the File Is Corrupted: Is the Large File Being Truncated Mid-Transfer?
Date: Nov 19, 2026 Read: 22




