<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[jqui-mfd: image-Request und 304 Problem ?]]></title><description><![CDATA[<p dir="auto">Ich habe ein Problem mit dem jqui-mfd Adapter, und hier speziell mit dem Window-Widget, ggf. in Verbindung mit dem web-Adapter.</p>
<p dir="auto">Der Trace zeigt, dass der Webserver von den immer gleichen image-Requests "fts_window_1w.svg" und "fts_window_1w_open.svg" geflutet wird. In 60 sec. über 500 Anfragen, die entsprechend Last und Ressourcen verbrauchen:</p>
<p dir="auto"><img src="/assets/uploads/files/1653822039918-bild-259.png" alt="Bild 259.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Als Antwort wird auf die dauerhaften image-Anfragen des Window-Widgets ein 304 - not modified erzeugt :</p>
<p dir="auto"><img src="/assets/uploads/files/1653825274959-bild-260.png" alt="Bild 260.png" class=" img-fluid img-markdown" /><br />
Bei 304 dürften m.E. keine Nutzdaten zwischen Browser und Webserver ausgetauscht werden. Lt. Trace sind dieses jedoch ca. 150kB pro min.</p>
<p dir="auto">Der Code in der index.html, der dieses Verhalten auslöst ist in der Funktion "tplMfdWindowBool" enthalten:</p>
<pre><code>&lt;script id="tplMfdWindowBool"
        type="text/ejs"
        class="vis-tpl"
        data-vis-set="jqui-mfd"
        data-vis-type="val,window"
        data-vis-name="Window"
        data-vis-prev='&lt;div id="prev_tplMfdWindowBool" style="position: relative; text-align: initial;padding: 4px "&gt;&lt;div class="vis-widget_prev ui-widget ui-button ui-corner-all ui-state-default ui-state-active" style="height: 70px; width: 70px;"&gt; &lt;div class="vis-widget-prev-body"&gt; &lt;img style="filter: invert(1); -webkit-filter: invert(1); -moz-filter: invert(1); -o-filter: invert(1); -ms-filter: invert(1);" height="100%" src="widgets/jqui-mfd/img/fts_window_1w_open.png"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;'
        data-vis-attrs="oid;invert_icon/checkbox;invert_state/checkbox;asButton[true]/checkbox;iconColor/color;"
        data-vis-attrs0="group.values;closed_value;opened_value;"
        data-vis-attrs1="group.icons;closed_icon/image;closed_iconColor/color;opened_icon/image;opened_iconColor/color;"
        &gt;
    &lt;div class="vis-widget &lt;%= this.data.attr('asButton') ? ' ui-widget ui-button ui-corner-all ui-state-default' : '' %&gt; &lt;%= this.data.attr('class') %&gt;" id="&lt;%= this.data.attr('wid') %&gt;" data-oid="&lt;%= this.data.attr('oid') %&gt;" style="height:76px; width:76px; position:absolute" data-min="&lt;%= this.data.attr('closed_value') %&gt;" data-max="&lt;%= this.data.attr('opened_value') %&gt;" &lt;%= (el) -&gt; this.data.attr('asButton') ?  vis.binds.jqueryui.active(el, this.data.invert_state) : '' %&gt; &gt;
        &lt;div class="vis-widget-body"&gt;
            &lt;%
            var styles = '';
            if (this.data.invert_icon === 'true' || this.data.invert_icon === true) {
                 styles = 'filter: invert(1); -webkit-filter: invert(1); -moz-filter: invert(1); -o-filter: invert(1); -ms-filter: invert(1);';
            }

            var opened = this.data.attr('opened_value');
            var closed = this.data.attr('closed_value');

            var val = vis.states.attr(this.data.oid + '.val');

            if (opened === undefined || opened === '' || opened === null) {
                opened = 1;
                closed = 0;

                if (val === 'true'  || val === true)  val = opened;
                if (val === 'false' || val === false) val = closed;

                val = parseFloat(val) || 0;
                val = (val &gt; closed) ? opened : closed;
            }
            if (this.data.invert_state) {
                if (val == opened) {
                    val = closed;
                } else {
                    val = opened;
                }
            }

            var image = null;
            var imageColor = null;
            if (val != opened) {
                imageColor = this.data.attr('closed_iconColor') ? this.data.attr('closed_iconColor') : this.data.attr('iconColor');
                image = this.data.attr('closed_icon');
                if (!image) {
                    image = imageColor ? "widgets/jqui-mfd/img/fts_window_1w.svg" : "widgets/jqui-mfd/img/fts_window_1w.png";
                }
            } else {
                imageColor = this.data.attr('opened_iconColor') ? this.data.attr('opened_iconColor') : this.data.attr('iconColor');
                image = this.data.attr('opened_icon');
                if (!image) {
                    image = imageColor ? "widgets/jqui-mfd/img/fts_window_1w_open.svg" : "widgets/jqui-mfd/img/fts_window_1w_open.png";
                }
            }

            if (vis.binds['jqui-mfd'].isNotEmpty(imageColor)) {
            %&gt;
                &lt;img style="&lt;%= styles %&gt;" width="100%" src="&lt;%= image %&gt;" &lt;%= (el) -&gt; vis.binds.jqueryui.setSvgColor(el, imageColor) %&gt;/&gt;
            &lt;% 
            } else {
            %&gt;
                &lt;img style="&lt;%= styles %&gt;" width="100%" src="&lt;%= image %&gt;" &lt;%= (el) -&gt; vis.binds['jqui-mfd'].removeSvg(this.data.attr('wid')) %&gt;/&gt;
            &lt;% 
            } 
            %&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/script&gt;
</code></pre>
<p dir="auto">Die Adapter web, socket, vis und jqui-mfd sind alle auf aktuellem Stand, Cacheing ist im web-Adapter aktiviert. Testweise habe ich den web-Adapter auch auf eine ältere 4er-Version gedowngraded, das 304-Verhalten ist aber identisch geblieben.</p>
<p dir="auto">Könnt ihr ein ähnliches Verhalten feststellen - sind die image-Requests im Millisekunden-Bereich und die 304-Behandlung so OK oder ist das ein Bug ?</p>
]]></description><link>https://forum.iobroker.net/topic/55247/jqui-mfd-image-request-und-304-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 11:42:53 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/55247.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 May 2022 12:10:21 GMT</pubDate><ttl>60</ttl></channel></rss>