Skip to content

Etag for previews / thumbnails #35029

Closed
Closed

Description

@PVince81

I wonder if we should use etags for our thumbnails. this would let the browser query whether there's a new preview.

The endpoint would need to check the etag against the file's etag and return 304 not modified if there is no change instead of attempting to read the existing thumbnail from disk

For that we can simply use the file's etag from oc_filecache early on

It might not be much for the small thumbsnails but would save more traffic for files_mediaviewer when accessing bigger previews.

Maybe the preview size needs to be computed into the etag

I wonder if it would work as well with video previews...

Need to research whether browsers store Etags based only the URL resource part or whether it also covers URL parameters. Depending on this we might or might not need to change the way how the URLs are constructed, which we'll likely not want to change yet again.

If it can work with the current URL scheme it could be worth a try.

Activity

  1. added this to the backlog milestone on Apr 16, 2019
  2. DeepDiver1975 commented on Apr 16, 2019

    @DeepDiver1975
    Contributor

    The new preview endpoint does not send the etag header in the response - the browser in return has no chance to cache anything.

    This was different in the old endpoint .... too bad.

    We should consider this a bug/regression.

  3. PVince81 commented on Apr 16, 2019

    @PVince81
    ContributorAuthor
  4. DeepDiver1975 commented on Apr 16, 2019

    @DeepDiver1975
    Contributor

    I think we never sent etags before, even in the old endpoint.

    hmmm .... did I mix this up with avatars ....

    anyway - as soon as we return etags the situation should get much better ....

  5. changed the title [-]Etag for previews / thumnails[/-] [+]Etag for previews / thumbnails[/+] on Apr 16, 2019
  6. stale commented on Sep 20, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions