* [frontend] WIP: pdf caching using service worker -- squashed
Ref: 920fbaa00b31530f7c457a2d93bad5e553798057
Co-Authored-By: Brian Gough <brian.gough@overleaf.com>
Co-Authored-By: Eric Mc Sween <eric.mcsween@overleaf.com>
* [misc] add contentId into the URL for protecting PDF stream contents
* [misc] gracefully handle missing ranges in serviceWorker
* [misc] support PDF stream caching for anonymous users
* [misc] polish header names and add URL to error message when fetch fails
* [misc] polish event handler registration
* [misc] limit serviceWorker scope to /project/ -- trailing slash
This will block the service worker from intercepting requests on the
project dashboard.
* [misc] add per-request feature flag for enabling PDF stream caching
* [misc] expose compile stats and timings to the frontend
* [misc] serviceWorker: support clsiServerId and compileGroup url params
* [misc] serviceWorker: polish header maps
* [misc] serviceWorker: drop TODO for p-limit -- the browser has a queue
* [misc] serviceWorker: drop verbose log message on every fetch
* [misc] cut down size of diff in backend code
* [misc] add test case for forwarding of pdf caching and metrics details
* [misc] serviceWorker: drop all the log lines
* [misc] serviceWorker: add boundary guards to the compile request regex
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 4b291b4a4f2866cf07bccf8ec9068f33bbfdc916
Retain a small part (6 or 9 bytes) of each chunk in memory for providing
the next iteration with enough context for finding the start/end marker
of a range.
* wip generate directory for hash content
* cleanup, remove console logging
* add content caching module
* Return PDF stream ranges with compile response
* Return the PDF file size in the compile response
* PDF range endpoint
* [misc] WIP: pdf caching: preserve the m-time on static content files
* [misc] WIP: pdf caching: improve browser caching, emit caching headers
* [misc] WIP: pdf caching: do not emit very small chunks <1kB
* [misc] keep up with moving output files into a separate directory
* [OutputCacheManager] add global feature flag for enabling pdf caching
* [misc] add contentId into the URL for protecting PDF stream contents
* [misc] support PDF stream caching for anonymous users
* [misc] add per-request feature flag for enabling PDF stream caching
* [misc] enable pdf caching in CI and emit metrics at the end of run
* [misc] expose compile stats and timings to the frontend
* [misc] log an error in case saving output files fails
* [misc] add metrics for pdf bandwidth and pdf caching performance
* [misc] add a dark mode to the pdf caching for computing ranges only
* [misc] move pdf caching metrics into ContentCacheMetrics
* [misc] add a config option for the min chunk size of pdf ranges
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>