I left to take a phone call and came back to the mini program, but the coupon still shows as usable—did this page only fetch data the first time it opened?
Conclusion first: when a user leaves to take a phone call and returns to the mini program, and the coupon still shows as usable, in most cases this is not phone lag or network disconnection—the page simply fetched data only once in onLoad. When a mini program goes to the background, the page instance is usually not destroyed; returning to it triggers onShow. If no code re-fetches data there, the screen stays at the moment the user left.
When returning to the foreground still shows old data, where are the common breakpoints?
A page usually goes through onLoad, onShow, onHide, and onUnload from opening to closing. onLoad runs only once for the same instance, while onShow runs again when returning to the foreground or coming back from another page. Writing data fetching only in onLoad assumes the user opens the page only once; after switching away and coming back, the page is still in the page stack, but no request is sent again.
The second type of breakpoint is caching and push. To make the first screen fast, projects often render a local snapshot first and then update asynchronously; if the asynchronous update fails or is skipped, users see old values. For pages that rely on persistent connections, if the connection is not re-established and messages are not backfilled after returning to the foreground, they also show old states. Such issues are more likely to surface on weak networks because failures often come with no prompt.
- Lifecycle breakpoint: no data fetching in onShow, or fetching only on first entry.
- Cache breakpoint: cache is read but no expiration time is set, and there is no silent refresh.
- Persistent-connection breakpoint: after returning to the foreground, the connection is not re-established and key fields are not backfilled.
- Page-stack breakpoint: after changing something on a detail page and returning to the list, the list's onShow also does nothing.
Which pages need to refetch data, and which do not?
Not all data is worth refreshing. There is only one criterion: if this number has already changed but the user still makes a decision based on the old value on screen, could that cause loss or complaints? Based on common delivery practices for e-commerce and appointment-based projects in 2026, this criterion is more useful than asking whether a page is 'important'.
- High time sensitivity: inventory, price, coupon eligibility, payment and refund status, appointment slots. If users place orders or visit a store based on old values, complaints are likely.
- Medium time sensitivity: order lists, points, unread message counts. You can add a time threshold or refresh only the first page of the initial screen.
- Low time sensitivity: store introductions, campaign rules, help documentation. Usually not auto-refreshed; pull-to-refresh or version updates act as a fallback.
Incidents usually come not from 'whether to refresh' but from 'refreshing the wrong place': truly high time-sensitivity fields are left unrefreshed on list pages, while purely introductory pages are made to spin every time they are opened. A reasonable baseline can be viewed this way: numbers that users treat as a basis for decisions should usually be updated once within tens of seconds after returning to the foreground.
Weighing the three refresh approaches
Full refresh, threshold-based refresh, and push plus partial update differ significantly in cost and experience. In the same project, they often need to be mixed rather than applying one approach globally.
- Full refresh: re-request the entire page's data on every onShow. Implementation is simple and consistency is good; common implementation effort is half a day to one day per page (experience range); API call volume is typically 30–50% higher than threshold-based refresh; on weak networks it is easily blocked by loading states. Suitable for highly time-sensitive pages with few APIs and small data volume.
- Threshold-based refresh: record the last fetch time, request only after the interval has passed, and force refresh when the user pulls down. Common implementation effort is around half a day per page (experience range); API volume can be reduced to around one-third of full refresh; the cost is maintaining timestamps and possibly missing data that changed within the threshold. Suitable for order lists and message centers.
- Push plus partial update: push changes to the frontend via subscription messages, persistent connections, or polling, and update only the affected blocks. The experience is better; common integration effort is three to five days (experience range), and you also need to handle disconnections, out-of-order messages, and backfilling on return. Suitable for queue number calling and delivery progress.
Whichever approach you choose, it is advisable to have the server validate once more before actions such as submit and payment. Frontend refresh only helps users see a state closer to reality; it cannot serve as a guarantee of correctness.
A delivery-site experience
There was an appointment-based project where the constraint was that the budget and schedule only allowed one round of refresh rework, while the requester also wanted 'pages to always look new'. Our approach was to list the fields that would change and affect decisions, configure onShow fetching only for inventory, slots, coupon status, and payment results, and keep pull-to-refresh for the remaining pages. As a result, first-screen speed and API call volume both fell within the typical range. The trade-off was that order lists might still not be real-time, so customer service scripts were needed after launch. Conversely, if every onShow across the site refreshed from the start, API call volume during stress testing commonly rises to more than twice the experience range, and later the work has to be rolled back and redone.
Applicable and non-applicable boundaries
Refresh strategies are suitable for scenarios where data changes frequently in the backend, users leave the page for a while and then return, and numbers on the page directly affect ordering or store-visit behavior—such as inventory, slots, coupon status, and payment and refund results. For these pages, it is worth writing the refresh logic into the acceptance checklist and verifying each item on real devices.
Boundary statement: If a page's data does not change at all during the few minutes a user stays, adding automatic refresh on return only increases requests and UI flicker, with close to zero benefit. Pure introductory pages, legal and rules pages, and form pages that users are actively filling out in sequence usually do not fall within the scope of automatic refresh. When unsure, first add only pull-to-refresh, observe real feedback for a period, and then decide whether to upgrade.
FAQ
If every return to the foreground triggers a full refresh, will it consume too many API calls?
Yes, and it is usually unnecessary. Classify by freshness: only high time-sensitivity pages must refresh, medium time-sensitivity pages add a time threshold, and low time-sensitivity pages do not refresh. API call volume can commonly be reduced to around one-third of full refresh (experience range).
If I switch away halfway through filling out a form and come back to find the content cleared by a refresh, what should be done?
This is a refresh strategy overreach. Pages in the middle of being filled out should skip automatic fetching, or first check whether there is unsubmitted content and restore user input after refresh, rather than letting API results directly overwrite the form.
If a subscription message has already been pushed, does the page still need to fetch data again itself?
Usually yes. Push only serves as a reminder; when the user taps in, the page instance may still be old. A common approach is to trigger fetching with parameters carried when the message is tapped, or pull key fields again in onShow.
On a real device, how do you confirm that the refresh strategy actually takes effect?
Use a real device rather than developer tools: open the page, switch to WeChat chat for two minutes, then switch back, and see whether key fields have changed; then repeat with the network disconnected and check whether there is a failure prompt instead of the screen staying on old values.
If you happen to have such a page at hand, do not rush to add refresh across the whole site: list the fields that change and whose change would cause users to make wrong decisions, configure return-to-foreground fetching only for those items, and have the server validate once before submission. The boundary of this approach is clear—where data barely changes, or users fill out the page continuously for a long time, adding automatic refresh makes things worse. Xiyue Company usually writes this field list into the acceptance items during delivery, so that problems are not discovered only after launch through user complaints.
-
Well-Recognized Custom E-Commerce Mall System DevThe Good Shopping mini-app is natively buil ...
-
Anhui Huixiang Vegetable Garden Agricultural Products Mini Program v2.0 Iteration DevelopmentHuiXiang MiniApp V2.0: Upgraded homepage, n ...
-
Kunshan TrialBook Mini-Program Custom DevelopmentThis project developed an English-only Tria ...
-
Agricultural Products WeChat Mini Program Custom DevelopmentLvran Di enhances agricultural sales via a ...
-
Grandparents turned WeChat font size up one notch—mini program button text wraps and the custom tab bar drifts. Is it hard-coded heights or uncontrolled font size?
Date: Nov 23, 2026 Read: 4
-
Why does tapping again while the order page is spinning create a duplicate order—is the button not locked, or is the API failing to recognize it?
Date: Nov 22, 2026 Read: 13
-
A poster can be recognized by long-pressing it in chat but does nothing on a Mini Program page—what step is missing?
Date: Nov 21, 2026 Read: 26
-
Mini program 'Locate to current position' lands in the neighboring community: approximate location or a coordinate conversion error?
Date: Nov 20, 2026 Read: 21
-
When I switch a mini program to a custom top navigation bar, why does the capsule button in the top-right keep covering the title—is the status bar height wrong or is the title width not clearing it?
Date: Nov 19, 2026 Read: 29




