mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #11236 from overleaf/jpa-pdf-caching-fix-size-estimation
[web] pdf-caching: fix estimation of multipart response size GitOrigin-RevId: 5929cc1e413befb3f931889b38a4b21a7ed4cea8
This commit is contained in:
parent
e00e17035c
commit
6154db8f92
1 changed files with 3 additions and 2 deletions
|
@ -10,7 +10,7 @@ const HEADER_OVERHEAD_PER_MULTI_PART_CHUNK = composeMultipartHeader({
|
||||||
start: 9 * 1024 * 1024 * 1024,
|
start: 9 * 1024 * 1024 * 1024,
|
||||||
end: 9 * 1024 * 1024 * 1024,
|
end: 9 * 1024 * 1024 * 1024,
|
||||||
size: 9 * 1024 * 1024 * 1024,
|
size: 9 * 1024 * 1024 * 1024,
|
||||||
})
|
}).length
|
||||||
const MULTI_PART_THRESHOLD = 4
|
const MULTI_PART_THRESHOLD = 4
|
||||||
const INCREMENTAL_CACHE_SIZE = 1000
|
const INCREMENTAL_CACHE_SIZE = 1000
|
||||||
// Download large chunks once the shard bandwidth exceeds 50% of their size.
|
// Download large chunks once the shard bandwidth exceeds 50% of their size.
|
||||||
|
@ -88,7 +88,8 @@ function estimateSizeOfMultipartResponse(chunks) {
|
||||||
(totalBytes, chunk) =>
|
(totalBytes, chunk) =>
|
||||||
totalBytes +
|
totalBytes +
|
||||||
HEADER_OVERHEAD_PER_MULTI_PART_CHUNK +
|
HEADER_OVERHEAD_PER_MULTI_PART_CHUNK +
|
||||||
(chunk.end - chunk.start)
|
(chunk.end - chunk.start),
|
||||||
|
0
|
||||||
) + ('\r\n' + SAMPLE_NGINX_BOUNDARY + '--').length
|
) + ('\r\n' + SAMPLE_NGINX_BOUNDARY + '--').length
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue