mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #10383 from overleaf/jpa-pdf-caching-avoid-cache-for-range-request
[web] pdf-caching: avoid browser cache for range requests on output.pdf GitOrigin-RevId: 546380cfb24094db0af7de0f47f5a69c60b0586d
This commit is contained in:
parent
72c1f9f0d8
commit
28414b118d
2 changed files with 14 additions and 4 deletions
|
@ -4,7 +4,7 @@ import { trackPdfDownloadEnabled } from './pdf-caching-flags'
|
|||
|
||||
// VERSION should get incremented when making changes to caching behavior or
|
||||
// adjusting metrics collection.
|
||||
const VERSION = 8
|
||||
const VERSION = 9
|
||||
|
||||
// editing session id
|
||||
const EDITOR_SESSION_ID = uuid()
|
||||
|
|
|
@ -472,6 +472,7 @@ function checkChunkResponse(response, estimatedSize, init) {
|
|||
export async function fallbackRequest({ url, start, end, abortSignal }) {
|
||||
try {
|
||||
const init = {
|
||||
cache: 'no-store',
|
||||
headers: { Range: `bytes=${start}-${end - 1}` },
|
||||
signal: abortSignal,
|
||||
}
|
||||
|
@ -809,7 +810,10 @@ export async function fetchRange({
|
|||
coalescedDynamicChunks.push({
|
||||
chunk: dynamicChunks[0],
|
||||
url,
|
||||
init: { headers: { Range: `bytes=${byteRanges}` } },
|
||||
init: {
|
||||
cache: 'no-store',
|
||||
headers: { Range: `bytes=${byteRanges}` },
|
||||
},
|
||||
})
|
||||
break
|
||||
case dynamicChunks.length <= MULTI_PART_THRESHOLD:
|
||||
|
@ -820,7 +824,10 @@ export async function fetchRange({
|
|||
coalescedDynamicChunks.push({
|
||||
chunk,
|
||||
url,
|
||||
init: { headers: { Range: `bytes=${chunk.start}-${chunk.end - 1}` } },
|
||||
init: {
|
||||
cache: 'no-store',
|
||||
headers: { Range: `bytes=${chunk.start}-${chunk.end - 1}` },
|
||||
},
|
||||
})
|
||||
})
|
||||
break
|
||||
|
@ -828,7 +835,10 @@ export async function fetchRange({
|
|||
coalescedDynamicChunks.push({
|
||||
chunk: dynamicChunks,
|
||||
url,
|
||||
init: { headers: { Range: `bytes=${byteRanges}` } },
|
||||
init: {
|
||||
cache: 'no-store',
|
||||
headers: { Range: `bytes=${byteRanges}` },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue