Expose whether a response was served from cache on HttpResponseInfo
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- mobile, observability
Research direction
Start by reading the HttpResponseInfo and RumResourceAttributesProvider APIs, then inspect how DatadogInterceptor records RUM resources and how the OkHttp and Cronet integrations represent cached responses. The issue gives no file paths or tests, so first locate those entry points and their tests. Done means HttpResponseInfo can report whether the response came from cache across supported clients; consider whether skipping resources for responses that never reached the network belongs in scope.
Written by the indexing model from the issue text.
Description
With the move to HttpRequestInfo/HttpResponseInfo, RumResourceAttributesProvider can no longer tell whether a response hit the network. The deprecated okhttp3.Response overload is the only way to read networkResponse.
OkHttp answers CacheControl.FORCE_CACHE misses with a synthetic 504 Unsatisfiable Request (only-if-cached), and serves disk-cache hits locally. DatadogInterceptor records both as RUM resources. In our production Android app, about 84% of native resources were these synthetic 504s. We drop them by tagging networkResponse == null in the deprecated overload and returning null from setResourceEventMapper.
Request: a network-agnostic flag on HttpResponseInfo, such as isFromCache (OkHttp: networkResponse == null; Cronet: UrlResponseInfo.wasCached()). Ideally, also an option to skip RUM resources for responses that never reached the network.
Related: #3365 (body access added via peekBody).
- Dominant language
- Kotlin
- Stars
- 227
- Forks
- 87
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/dd-sdk-android
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
DataDog/dd-sdk-android#3976 · 2 comments ·
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
DataDog/dd-sdk-android#3888 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 32/100
DataDog/dd-sdk-android#3223 · 4 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
automatically closed question stale
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataDog/dd-sdk-android#2970 · 6 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
DataDog/dd-sdk-android#2700 · 1 comment ·
Maintainers usually reply within 1 day
All issues in DataDog/dd-sdk-android
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/enriched-markdown#1084 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lysine-dev/okhttp#9814 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getdictus/dictus-android#187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
bryangerlach/rdgen#319 ·