-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache previews 404 responses #17557
Comments
Not sure about this. The browser will be able to detect changes via the etag, but clients won't and people will complain that they don't see the files they've just uploaded, no? |
If they upload new files, there will be new file names. |
I think I'm missing some context here. ☕ |
Webdav does not serve previews at all. The Webdav branch still uses the existing previews API endpoint. |
OK. |
Hmmm good point. I think this is mostly about JS apps that run the web browser, because the browser will use the headers. Not sure about external apps. You don't actually need to send the etag, you can also send a random string but then you'd get it from a real server request each time. I think changing the behavior with 404 will not harm more than the actual caching already does (if there is harm at all) |
OK, so ask the browser to cache requests and send a random string at every request for apps which don't handle etags. |
Wouldn't it make more sense to have the available preview type in the capabilities.... then clients would only request previews on types that actually support it. |
@rullzer - The problem is that a preview can fail (missing encryption key, corrupt file, missing file, etc.), so the frontend would still need to get some kind of error. 500 is probably better, but I think these cases still generate 404s. |
@rullzer of course it would be better to have OC.Previews with the preview types. |
OC.Previews ticket here #17543 (just linking) |
Duplicate of #13609 ? |
Not exactly. I think the caching from #13609 is about the gallery folder. This ticket is about letting the browser cache the 404 response by setting the correct cache headers instead of setting a "don't cache this" header style. |
Likely obsolete, @VicDeo I think we got rid of those 404 ? If yes, please close. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Clients might not know whether a file type has a preview available, so they will connect and receive a 404. However I noticed that the 404 response contains "no-cache".
We should let browsers/clients cache 404 responses for previews to avoid further requests.
Note that in the browser's case we already send an additional parameter "c" that contains the instance id and etag, so if the file ever changes, a new preview would be loaded.
@oparoz @rullzer @georgehrke @DeepDiver1975 what do you think ?
Also note that with the WebDAV approach we might get more 404 as we won't know if previews are available either (#12353)
The text was updated successfully, but these errors were encountered: