My PHP application, LMS (https://github.com/decision-making-mike/lms), is meant to be deployed on the web server as a usual website. I expect that the visible state of it always be the same. By that I mean, e.g., that whenever the user opens a view with a form, the form must have its values empty.
But some time ago I noticed that when I was using LMS in Lynx, there sometimes showed up old data in a form (as I'm checking now, that's not the case in Chrome). This is what issue 7 is about (https://github.com/decision-making-mike/lms/issues/7). I examined the Lynx documentation, and I figured out it might have something to do with caching. I found out that the problem is solved when you use the X key (or SHIFT-X) instead of ENTER, at least in some cases. But this might change habits of the user, and I wanted something which wouldn't. So I looked deeper in the documentation, and I found <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> and <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> I didn't like these solutions, though (for reasons explained in issue 7). Thankfully, Lynx documentation mentioned two alternatives, that is, to send "a 'Pragma' or 'Cache-Control' MIME header with a no-cache directive" (https://lynx.invisible-island.net/lynx_help/Lynx_users_guide.html). I applied one of them and it appeared to solve the problem. The code is header('Cache-Control: no-cache'); (it's placed at the beginning of index.php). However, this solution creates one problem: Lynx happens to sometimes issue an alert that reads "Alert!: Reloading document. All form entries will be lost!" (and is red). Much as I don't consider it a bug, it makes user experience worse. (And if you saw the "bug" tag in the issue: it pertains to the underlying data remanence problem.) When it comes to me, I haven't stopped using LMS with the alert, but other users, I presume, might get driven away (not that LMS have any users already. It doesn't even have a license. But good to be ready). I determined that the following steps describe the most straightforward case when it happens: 1. Open the view of the "(NA)" task (the default after opening LMS), 2. insert "a" in the search input, 3. use the link "ALL TASKS", 4. open the view of the "(NA)" task again (the first one). The actual behavior is that there is issued an alert. The expected behavior be that there is no alert issued. So, maybe someone could explain to me: 1. why Lynx issues that alert, 2. whether it can be prevented, 3. if it can, whether it's advised against, 4. if it's not advised against, how can I prevent it, 5. if it's advised against, how should LMS handle caching so the user not experience such alerts. Mike
