clearInterval 会导致重定向吗?

Does clearInterval cause redirect?

我有一个实时 link 到相机图像,当鼠标悬停在 link 上时会显示该图像。由于 setInterval,我不喜欢服务器日志充满每隔几秒加载一次图像的 GET。

所以我为 setInterval 和 clearInterval 添加了 onmouseover 和 onmouseout 事件。这确实减少了服务器日志中的事件数。但现在每次事件触发时,我都会收到 200 和 301 代码。

在添加鼠标事件之前,我只从 setInterval 中获得了 200 个代码。我的问题是,有没有办法阻止 301 重定向,是否是 clearInterval 导致的?

var hold = null;
document.getElementById("test1").onmouseover = function() {
  mouseOver()
};
document.getElementById("test1").onmouseout = function() {
  mouseOut()
};

function mouseOver() {
  var imgname = document.getElementById('imgfeed').src.split("?");
  hold = setInterval(function() {
    document.getElementById('imgfeed').src = imgname[0] + "?xrand=" + Math.floor((Math.random() * 1000) + 1);
  }, 10000);
}

function mouseOut() {
  clearInterval(hold);
}
.feedbtn:hover+.livefeed,
.feedbtn:active+.livefeed {
  display: block;
}

.livefeed {
  display: none;
}
<body>
  <div id="test1">
    <ul>
      <li><a class="feedbtn">LINK</a>
        <div class="livefeed">
          <img src="link to camera image" alt="Feed" id="imgfeed" />
        </div>
      </li>
    </ul>
  </div>
</body>

问题是 img src link 有 www,但服务器在 www links 上使用 301 重定向。从 link 中删除 www 解决了问题