Bug #19899
closedStale cache wb2 in collection file list
Description
Observed with the following sequence of events:
- Create an empty collection
- Visit the empty collection with Workbench 2
- Use arv-put --update-collection to upload a file to the collection
- Hit "Refresh" on the collection page
- The file list panel remains empty
The panel remains empty across visiting different collections and coming back as well as reloading the page, which suggests this is a caching issue, either the browser caching the keep-web response, or (more likely?) keep-web caching the collection listing.
After a couple minutes, the file I uploaded with arv-put started showing up.
Discussion on 1/5
keep-web supports "Cache-Control: no-cache" and "...must-revalidate" headers, but currently workbench2 does not use them, even when the user explicitly asks for a refresh.
Another possibility is for workbench2 to use the PDH rather than UUID when requesting file listings. (However, if the user clicks through to view file content at a webdav url, they might still receive old/cached content.)
Another possibility is adding a keep-web feature allowing the client's request header to supply the expected PDH when requesting file listings/content by collection UUID. If the PDH of the keep-web cache doesn't match, this would force a reload. This would be better than the previous approach in that when the user subsequently clicks through to the file content, the cache will also be up to date.
Plan¶
- Write a cypress test that demonstrates the bug (loads the collection page, then modifies the collection on the API server, then reloads the page and checks for the change)
- Add "Cache-control: must-revalidate" to the WebDAV requests
- Confirm that the cypress test passes with the addition of the Cache-control header.