fuel9 / DisplayMonkey

Display Monkey digital signage solution
Other
126 stars 50 forks source link

Why do all images become 4MB?And how to use the browser's cached resources instead of reinitiating the resource request? #71

Closed txjchu closed 5 years ago

txjchu commented 5 years ago

我发现我们的设备的WIFI信号比较差,每个display中加载资源都会非常的慢。所以有几个问题想请教下大家,

  1. 为什么所有的图片都被处理成4MB(当原图小于4MB时候),是否可以修改或设置为图片不被处理。
  2. 怎样使用浏览器的缓存资源,而不是重新发起资源请求。
  3. 有点不太理解在很多frame中设置_Cache expiration_后,“Until the limit has been reached a cached copy stored in the server (the Display Monkey host) memory will be served. Frame content will also be refreshed in case changes has been made prior the time limit has been reached. ”这种做法的使用意义和情景。

Each display loads resources very slowly.So, I'd like to ask you a few questions.

  1. Why do all images become 4MB? How can i modify or set the image to not be processed?
  2. How to use the browser's cached resources instead of reinitiating the resource request?
  3. It's a little confusing, when i set Cache expiration in some frames ,than “Until the limit has been reached a cached copy stored in the server (the Display Monkey host) memory will be served. Frame content will also be refreshed in case changes has been made prior the time limit has been reached. ”,What does this mean?

emmm......Thanks a lot for any guidance

psined1 commented 5 years ago

Hi, thanks for reaching out. Regarding your bullets -

  1. Your first and second questions seem unrelated, yet bulleted together. A bit unclear what you mean. Please elaborate.
  2. DM does not rely on browser's cache for a number of reasons; a varying cache implementation between different browsers for one. Another reason is that your frame content is served by the server and therefore may change any minute, so relying on browser cache is not a good idea.
  3. DMP server offers server side content cache to prevent excessive use of server side CPU. For example, resizing an image to fit the panel dimensions is a high intense CPU operation. Another example is calendar events; caching some for a certain time to avoid excessive web API calls to Exchange server helps reduce load on DMP server and mitigate latency. In both examples, DMP will generate content and serve it cached from server memory instead of generating it over and over. Not all frame types allow for caching, one example is a clock frame.

Hope this explains. Also, for the benefit of other guests, please use English to post in this repository.

txjchu commented 5 years ago

@psined1 Thanks for your response ! Now I understand the second question and the third question . The first question , I mean the images has been changed when you upload them , so is there any way to keep images from changing ? You can refer to the following figure . 1qq 20181009144200

psined1 commented 5 years ago

Depending on frame picture mode you opt in (stretch, fit, crop, etc.) the image gets processed on the DMP server to counter variances between the image metrics and the corresponding panel dimensions pixel for pixel. The original image geometry and format remain unchanged in DM database. Ideally, if you don't want pictures resized, you want the DIB metrics of the picture match the panel geometry. In that case, the picture will be served as is. The algorithm used to process images might not be the most optimal one, based on your experience. However, it could simply be that your panel size is way bigger than that of the source image, so, quite logically, the output image will be larger in size. If you are a skilled developer and feel like volunteer great improvement ideas, please be our guest. We welcome contributions. Thanks for your interest in Display Monkey.

txjchu commented 5 years ago

OK,i see ,leave it at that. :smiley: Thanks again for your patience.