Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a cached copy of Replay resources for playback #18154

Open
benjackwhite opened this issue Oct 24, 2023 · 2 comments
Open

Make a cached copy of Replay resources for playback #18154

benjackwhite opened this issue Oct 24, 2023 · 2 comments
Labels
enhancement New feature or request feature/replay Features for Team Replay

Comments

@benjackwhite
Copy link
Contributor

benjackwhite commented Oct 24, 2023

Is your feature request related to a problem?

Some resources for a replay are not always available at playback either due to CORS reasons or bundle reasons (new release creates a new ID for an image etc, deleting the old one.

Describe the solution you'd like

We already have a WIP CORS proxy handling fonts. We could consider extending this to all resources and include a caching mechanism. In my mind it would work something like:

  1. On ingestion, we detect resources that should be downloaded (fonts, images, css etc.) and write them to some sort of processing queue
  2. The processing queue will attempt to download that respource if it doesn't already exist and write it to an S3 bucket keys like {team_id}/{base64(url)}
  3. On playback we swap out these URLs for our proxy service (we already do this ) to instead call our proxy service
  4. The proxy service goes to S3 for the data if we have it, otherwise attempts to proxy to the original url

What makes this hard?

The main thing here is protecting from abuse, either purposeful or accidental. We don't want to end up downloading outrageous amounts of data from 3rd parties.

We could limit this risk by

  1. Only enabling this for paying users
  2. Having a strict size limit on these resources (1mb or maybe even lower)
  3. Sensible TTLs on the assets

Additional context

Customer request

Thank you for your feature request – we love each and every one!

@pauldambra
Copy link
Member

pauldambra commented Mar 7, 2024

there is I think big overlap here rrweb-io/rrweb#1239 and here rrweb-io/rrweb#1433

@eoghanmurray
Copy link

rrweb/#1433 and #1239 are both now in #1475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature/replay Features for Team Replay
Development

No branches or pull requests

4 participants