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

fix: Use force-cache when fetching debug IDs #78456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timfish
Copy link
Contributor

@timfish timfish commented Oct 2, 2024

When fetching JavaScript source files to get their debug IDs, we leave the cache setting as default which means:

  • default — The browser looks for a matching request in its HTTP cache.
    • If there is a match and it is fresh, it will be returned from the cache.
    • If there is a match but it is stale, the browser will make a conditional request to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated.
    • If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.

In the case of fetching debug IDs, we are not bothered about the cache match being fresh or stale. Regardless of the staleness, the source file in the cache is much more likely to be the code that is currently executing.

  • force-cache — The browser looks for a matching request in its HTTP cache.
    • If there is a match, fresh or stale, it will be returned from the cache.
    • If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.

Using force-cache can result in less conditional requests checking if the source has changed.

Of course, Sentrys JavaScript assets might be so heavily cached that this makes little to no difference!

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 2, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Oct 24, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Oct 24, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Nov 15, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Nov 15, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Dec 8, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Dec 8, 2024
@getsantry
Copy link
Contributor

getsantry bot commented Dec 31, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant