Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
¿Existe algún tipo de límite de tamaño al usar solicitudes de rango en el navegador Chromium?

Uso el siguiente código para hacer una solicitud de rango a un archivo de modelo grande en el servidor y luego muestro el modelo usando 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, }) ); }) })

El método downloadRange es así:

 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(); }); }

Cuando m (tamaño de rango) es más pequeño que aproximadamente 1024*1024*6 (alrededor de 6 mb), la solicitud se devolverá correctamente; sin embargo, cuando m es mayor que eso, el navegador dirá GET <url> net::ERR_FAILED 206 (Partial Content) y la solicitud fallaría. Cuando utilizo cartero para probar el servicio, vuelve normalmente con un tamaño mucho mayor (30 mb), por lo que no debería haber ningún problema en el lado del servidor. Me pregunto qué causaría esto. ¿Hay algún tipo de límite en el cromo? ¿Hay alguna forma de evitarlo? Gracias por cualquier respuesta de antemano.

Esto sucedería tanto en Chrome como en Edge, y quizás en otros navegadores.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!