GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Helps users quickly understand if a resource script was loaded from a cache or not · Issue #79651 · getsentry/sentry

Helps users quickly understand if a resource script was loaded from a cache or not #79651

New issue
Copy link
New issue
Copy link
Open
Open
Helps users quickly understand if a resource script was loaded from a cache or not#79651
Copy link
Assignees
Abdkhan14
Labels
Feature

Description

@Dhrumil-Sentry
Dhrumil-Sentry
opened on Oct 23, 2024
Issue body actions

Problem Statement

Lukas has made a helpful proposal here: getsentry/sentry-javascript#14056

Let's use his logic and new attribute to show users whether a resource span was fetched from a cache or not

Solution Brainstorm

.

Product Area

Explore

Reacted by Lukas Stracke

Activity

  1. Dhrumil-Sentry
    assigned
    Abdkhan14
    on Oct 23, 2024
  2. Lms24 commented on Oct 24, 2024

    @Lms24
    Lms24
    on Oct 24, 2024
    Member
    More actions

    Thanks for considering my proposal! I'll post my algorithm here again, just to have things where they belong:

    function wasResourceCached(attributes: SpanAttributes): 'hit' | 'miss' | 'unknown' {
      const deliveryType = attributes['http.response_delivery_type'];
      if (deliveryType != null) {
        return deliveryType === '' ? 'miss' : 'hit';
      }
    
      const transferSize = attributes['http.http.response_transfer_size'] as number | undefined;
    
      if (!transferSize) {
        return 'unknown';
      }
      if (transferSize > 0) {
        return 'miss';
      }
    
      const decodedBodySize = attributes['http.decoded_response_content_length'] as number | undefined;
      if (!decodedBodySize) {
        return 'unknown';
      }
    
      if (decodedBodySize > 0) {
        return 'hit';
      }
    
      return 'unknown';
    }

    (There are some type issues in this code which we should adress to get rid of the typecast. Please feel free to adjust as you see fit!)

    I'll also link some sources as to where I took this from:

    • MDN docs on deliveryType
    • MDN docs on transferSize (including the very example for our the check when deliveryType is not set)
    • MDN docs on Resource performance entry

    Final remark: The first check for deliveryType diverges a bit from MDN because in my PR where I add deliveryType to the spans, I had to use "default" instead of the empty string "", which is the actual default of deliveryType. I'm still checking with ingest if there's a bug that makes us drop attributes with empty string values. If that's the case and we can fix it, I'll remove sending "default" and simply stick to the empty string to stay consistent with the browser API.

    Edit: Updated algorithm to what the SDK is going to send once getsentry/sentry-javascript#13502 lands

  3. Lms24 commented on Oct 28, 2024

    @Lms24
    Lms24
    on Oct 28, 2024
    Member
    More actions

    Update: I will make a slight adjustment to what specific strings we send, since the SDK depends on a Relay change (getsentry/relay#4174) to keep things better aligned with the values sent from the browser. We'll not send "default" for when a request was actually made but the empty string"", which is exactly what the browser sets in this case.

  4. Lms24 commented on Nov 15, 2024

    @Lms24
    Lms24
    on Nov 15, 2024
    Member
    More actions

    Update: The SDK changes have landed in v8.37.0. So from SDK PoV, the product can now adapt the changes :)

  5. linear
    added
    Migrated
    on Jan 9, 2025
  6. gaprl
    removed
    Migrated
    on Mar 5, 2025
  7. ghost added
    getsentry/sentry
    on Apr 15, 2025
  8. linear
    added
    Explore > Traces
    Feature
    on Apr 15, 2025
  9. github-actions
    removed
    Explore > Traces
    getsentry/sentry
    Feature
    on Jul 22, 2025
  10. ghost added
    Feature
    on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Abdkhan14
    Abdkhan14

Labels

Feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.