Object webpages should not preload full-size image attachments #11545

Open
opened 2025-12-29 21:46:37 +01:00 by adam · 3 comments
Owner

Originally created by @llamafilm on GitHub (Aug 30, 2025).

NetBox version

v4.4.0-beta1

Feature type

Change to existing functionality

Proposed functionality

When loading any model webpage (i.e. /dcim/locations/12218/), all Image Attachments are preloaded so that they can be displayed when hovering the mouse over the filename. For large images, this can slow down page loading and waste bandwidth.
Now in 4.4.0 we have thumbnails for each image, so it would be better to pre-load those instead, since they are only used for a small popup. Clicking on the image would still load the full image

Use case

It would speed up page loading and reduce network traffic. In this example, the network console shows the image-attachments page loading about twice as fast as the location page.

Image Image

Database changes

No response

External dependencies

No response

Originally created by @llamafilm on GitHub (Aug 30, 2025). ### NetBox version v4.4.0-beta1 ### Feature type Change to existing functionality ### Proposed functionality When loading any model webpage (i.e. `/dcim/locations/12218/`), all Image Attachments are preloaded so that they can be displayed when hovering the mouse over the filename. For large images, this can slow down page loading and waste bandwidth. Now in 4.4.0 we have thumbnails for each image, so it would be better to pre-load those instead, since they are only used for a small popup. Clicking on the image would still load the full image ### Use case It would speed up page loading and reduce network traffic. In this example, the network console shows the image-attachments page loading about twice as fast as the location page. <img width="1624" height="1271" alt="Image" src="https://github.com/user-attachments/assets/7e076201-72aa-47ed-a744-ba29c7acd9e0" /> <img width="1624" height="1271" alt="Image" src="https://github.com/user-attachments/assets/bab3432b-f100-4132-ad28-5bdeba745f51" /> ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: needs ownernetboxcomplexity: low labels 2025-12-29 21:46:37 +01:00
Author
Owner

@Genluck commented on GitHub (Oct 26, 2025):

+1 to this feature.
We have big images with detailed info (~5Mb per image, several of them) and it takes time for page to pre-load them. And the CSS of the page affecting by it. Browser at first is loading attached images and only after that it is applying page scheme. As result we may see this for quite a long time:

Image

About complexity of the change: need add to the script creating thumbnails on image upload (not just % of the image, but with logic like "not biggre image resolution and file size above x value")and also will need to create a script for NetBox updating process to create thumbnails from existing images (to avoid re-uploading images)

@Genluck commented on GitHub (Oct 26, 2025): +1 to this feature. We have big images with detailed info (~5Mb per image, several of them) and it takes time for page to pre-load them. And the CSS of the page affecting by it. Browser at first is loading attached images and only after that it is applying page scheme. As result we may see this for quite a long time: <img width="370" height="512" alt="Image" src="https://github.com/user-attachments/assets/e78e60c3-01be-49e8-8a3e-646c07f0818b" /> About complexity of the change: need add to the script creating thumbnails on image upload (not just % of the image, but with logic like "not biggre image resolution and file size above x value")and also will need to create a script for NetBox updating process to create thumbnails from existing images (to avoid re-uploading images)
Author
Owner

@rayzilt commented on GitHub (Oct 29, 2025):

I like to mention that what you see @Genluck, we see the same behavior. But we do not have any image uploaded at all.
This is a k3s deployment with Netbox Helm chart.

Image

Edit: I noticed that it hangs on showing the 'racks'. I think it's not related to the issue.
Refreshing the page gives a 1/5 ratio that the loading 'hangs'.

@rayzilt commented on GitHub (Oct 29, 2025): I like to mention that what you see @Genluck, we see the same behavior. But we do not have any image uploaded at all. This is a k3s deployment with Netbox Helm chart. <img width="1499" height="24" alt="Image" src="https://github.com/user-attachments/assets/2dc922ba-227d-4878-80c0-41b549190d53" /> Edit: I noticed that it hangs on showing the 'racks'. I think it's not related to the issue. Refreshing the page gives a 1/5 ratio that the loading 'hangs'.
Author
Owner

@Genluck commented on GitHub (Oct 29, 2025):

Checked on devices and sites (I have images there too). At all cases the menu coloring is loading after loading page images (including images preview). But images are loading last by browser, so, looks it is a web page code issue (it is waiting for loading of images and only after that it is finishing page construction).

@Genluck commented on GitHub (Oct 29, 2025): Checked on devices and sites (I have images there too). At all cases the menu coloring is loading after loading page images (including images preview). But images are loading last by browser, so, looks it is a web page code issue (it is waiting for loading of images and only after that it is finishing page construction).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11545