I have a website that queries a large database. It takes a while (3-10 sec) to generate a page. This is no problem for users, but I want to show a friendly message instead of the user just sitting in front of a page that is not changing. So what I did is I show a bootstrap modal saying "Please wait, we're loading your page" when a user clicks any particular link. That works well. The modal is shown on the page, and when the server has generated the new page, it will open and the modal clearly disappears.
The problem is when the user navigates to another link (again seeing the modal on the page), and then moves back. The previous modal is now shown. See overview below:
How to fix this?
Set this header
header("Cache-Control: private, must-revalidate,
max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.