Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

98
Vistas
Is there some kind of size limit when using range requests in Chromium browser?

I use following code to make range request to some large model file on the server, and then display the model using Cesium:

            const m = 1024 * 1024 * 3;
            Axios({
              url: option.url,
              method: 'head'
            }).then((res) => {
              const size = Number(res.headers['content-length']);
              const length = parseInt(size / m);
              const arr = []
              for (let i = 0; i < length; i++) {
                  let start = i * m;
                  let end = (i == length - 1) ?  size - 1  : (i + 1) * m - 1;
                  arr.push(this.downloadRange(option.url, start, end, i))
              }
              Promise.all(arr).then(res => {
                const arrBufferList = res.sort(item => item.i - item.i).map(item => new Uint8Array(item.buffer));
                const allBuffer = this.concatenate(Uint8Array, arrBufferList);
                primitive = viewer.scene.primitives.add(
                  new Cesium.Model({
                    gltf: allBuffer,
                    show: true, // default
                    modelMatrix: modelMatrix,
                    scale: parseFloat(option.scale) || 1,
                  })
                );
              })
            })

The downloadRange method goes like this:

downloadRange(url, start, end, i) {
      return new Promise((resolve, reject) => {
        const req = new XMLHttpRequest();
        req.open("GET", url, true);
        req.setRequestHeader("range", `bytes=${start}-${end}`);
        req.responseType = "blob";
        req.onload = function (oEvent) {
          req.response.arrayBuffer().then((res) => {
            resolve({
              i,
              buffer: res,
            });
          });
        };
        req.send();
      });
    }

When the m(range size) is smaller than about 1024*1024*6 (about 6mb), the request would be returned successfully, however when m is larger than that, the browser would say GET <url> net::ERR_FAILED 206 (Partial Content) and the request would fail. When I use postman to test the service it would return normally with a much larger size(30mb) so there should be no problem on the server side. I wonder what would cause this? Is there some kind of limit on chromium? Is there any way to get around it? Thanks for any reply in advance.

This would happen both on Chrome and Edge, and maybe other browsers.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda