st-tu-dresden / inloop

[Deprecated] A simple web application to manage online programming assignments
GNU General Public License v3.0
29 stars 8 forks source link

Editor may show stale content if navigated to via back button #396

Closed martinmo closed 4 years ago

martinmo commented 4 years ago

It seems like browsers (Firefox at least) cache quite aggressively and make the following possible:

  1. Ensure you have default browser settings (i.e., cache is not disabled).
  2. Open a task in the editor.
  3. Create a new file with example content and save it.
  4. Use the browser back button to go to previous page.
  5. Use the browser forward button to return to the editor.

Expected result: the new file is visible.

Actual result: the new file isn't visible, user must refresh the page.

In the browser console I can see that the cached version is used, which is somewhat expected. However, it's surprising that it doesn't execute the JS to initialize the tab bar. Possibly, I can work around this by settings extrem anti-caching headers on the editor and the checkpoint view.

martinmo commented 4 years ago

It turns out it is sufficient to designate the "get" checkpoint view as "never cache" :+1: