nextcloud / nextcloud/viewer

When viewing a single photo, a gigantic XML file is loaded every single time

Open
#520 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement medium performances
Dominant language
JavaScript
Stars
119
Forks
72
Avg merge
18h 42m
Merged PRs (30d)
24

Description

When viewing a photo, in the background also an XML is requested that seems to contain the complete directory structure info (endpoint remote.php/dav/files/<user>/Photos/). This same file is being requested over and over again every single time I click on a photo to open the viewer.

Now, as my /Photos/ folder contains a lot of files (roughly 15000), the XML response is gigantic: somewhere around 15 MB. This means, that every single time when I click on a photo, the browser redundantly requests that same huge XML file. This same file, btw. is also requested when first entering the directoy. So why requesting it over and over again?

The result, of course is unbearably slow response times and lag when trying to view a single photo from within a big directory.

To Reproduce
Steps to reproduce the behavior:

  1. Open browser network tab in dev tools and look for remote.php/dav/files/<user>/Photos/
  2. Go to a folder with lots of files
  3. Click on a photo to trigger the viewer
  4. Note, that a gigantic XML file is requested and that the photo is not shown until the XML is fully loaded
  5. Note that when closing the viewer and opening another photo, this same request of the XML file is fired again
  6. Note, how slow displaying an image becomes due to the redundant loading of the XML file
  7. Note, that when using the arrow buttons to switch to another photo, the XML is not requested again. It only happens during activation of the viewer

Expected behavior
Image in viewer loads quickly

Screenshots
grafik

Possible quick fix / workaround
The image file itself loads rather quickly. Maybe it is possible to display the image and not wait until the entirety of the XML is loaded (in case the redundant requests of the same XML file serve a purpose)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the photo viewer's activation flow and trace why opening a photo requests the remote.php/dav/files//Photos/ endpoint, using the browser network tab to reproduce it. Done means the image appears without waiting for a redundant 15 MB XML request, while switching photos with the arrow buttons continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.