Skip to content
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

Bugfix: Resized media urls result in the request path being too long #2107

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

iOvergaard
Copy link
Collaborator

Description

Some web servers carry a limit to the length of the request path. This harms the media thumbnail generator, which is a GET endpoint. We cannot change the backend as that would be a breaking change, nor do we wish to do it because of the purity of REST. So we are going to make a network request for each thumbnail instead. This is exactly what the old Backoffice did as well.

There are some advantages to doing this besides fixing the web servers: We can now space out the calls and wait until the elements are visible before initiating the request -- we will look into some of this in subsequential PRs.

The thumbnails are now also being cached in memory through a store in a nested map based on the media key (GUID) and thumbnail options (width, height, mode). This results in far fewer network calls when you have a lot of media showing up in the media library.

Fixes umbraco/Umbraco-CMS#16716

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

How to test?

  1. Upload more than 50 media items in a single folder in the Media library
  2. Check that no requests result in a 500 error (this error most likely won't happen on local Kestrel anyway)
  3. Check that all medias have their thumbnail URLs generated in separate requests

@iOvergaard iOvergaard changed the title Resized media urls result in the request path being too long Bugfix: Resized media urls result in the request path being too long Jul 10, 2024
Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested out against IIS Express (Windows/Visual Studio), I could reproduce the issue and this fix now resolves the issue. 🚀

@leekelleher leekelleher merged commit 1bf0a73 into main Jul 10, 2024
8 checks passed
@leekelleher leekelleher deleted the v14/fix/badge-thumbnails branch July 10, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More than 50 items in media folder results in Api error "Not Found"
2 participants