While using OpenList, the author accidentally discovered that a PDF file consistently downloaded an outdated version, even after multiple re-uploads. After a thorough inspection, it was concluded that the issue was caused by the browser cache, and a solution was provided. Hence, this record was made.
Issue URL: https://github.com/OpenListTeam/OpenList/issues/1550
In the WebUI, after a user uploads a new version of a file, they still see the outdated file content when viewing or downloading it through the browser.
Consistently reproducible. Successfully replicated and tested using both Edge and Firefox.
The issue is caused by browser caching.
After testing and verification, the core issue appears to be that the backend's response to GET file requests does not include the Cache-Control header, as shown in the figure:

The Cache-Control shown in the figure is located in the request header, which is automatically added by the browser. However, the Cache-Control header is absent in the response header returned by the backend.
To verify this, the following configuration was applied to Caddy:
handle @storage {
reverse_proxy http://127.0.0.1:15244 {
header_down Cache-Control "no-cache"
}
}
Among these, header_down Cache-Control "no-cache" is the added content.
After applying the configuration, packet capture revealed that the response header now includes Cache-Control: no-cache, as shown in the figure below:

After repeating the reproduction steps described in the issue above, it was found that the problem has been resolved, and the browser can now correctly display or download the latest version of the file.
Add Cache-Control: no-cache to the backend response at the reverse proxy. Using Caddy as an example:
handle @storage {
reverse_proxy http://127.0.0.1:15244 {
header_down Cache-Control "no-cache"
}
}
When the OpenList backend returns a file via GET request, including the response header Cache-Control: no-cache will resolve this issue.