Strip commercial tag properties for DCR tag pages - #28964
Draft
jorgeazevedo wants to merge 2 commits into
Draft
Conversation
Contributor
This was referenced Jul 23, 2026
jorgeazevedo
force-pushed
the
ja-strip-commercial-tag-pages
branch
from
August 14, 2026 23:38
535883c to
af4e850
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the value of this and can you measure success?
Applies
withoutCommercialstripping to the tag pages DCR endpoint, mirroring what was done for fronts in #27894. This will lead to reduced CPU usage and latency in the tag-page rendering service.Let's take the response from https://www.theguardian.com/tone/minutebyminute.json?dcr=true as an example.
Every tag instance inside
contents[].properties.maybeContent.tags.tags[].propertieshas 10 properties, for example:{ "id": "football/series/saturday-clockwatch", "url": "/football/series/saturday-clockwatch", "tagType": "Series", "sectionId": "football", "sectionName": "Football", "webTitle": "Clockwatch", "webUrl": "https://www.theguardian.com/football/series/saturday-clockwatch", "description": "Catch up with the scores and gossip from all of the day's major football fixtures kick-offs with our minute-by-minute reports", "references": [], "commercial": {} }All of these properties show up as properties in the DCR type
FETagTypeexcept forcommercial.As it happens,
commercialaccounts for 60% to 70% of the size of the total size of the DCR payload, and given it's not inFETagTypeit means the data being sent by Frontend, parsed, but not used by the client at all.How has this change been tested?
To confirm that the data isn't used in some indirect way, I tested this change by comparing the html returned by DCR with and without the commercial property using the following process.
I first obtained the JSONs from
mainand from this PR byDeploying
mainto CODE and runningDeploying this PR to CODE and running
I then individually posted all of the JSON to DCR using a series of curl calls like
curl -X POST https://localhost:9000/TagPage -H "Content-Type: application/json" -d @profile-code.json -o profile-code.htmland made sure I got the same exact number of bytes per html file both the trimmed and non-trimmed version of the JSON.mainJSONPerformance impact
By using the new tracing functionality (currently a WIP) we're able to see the impact quite clearly. While the request handler performance is the same, receiving the json over the network and parsing it becomes significantly quicker.
Here's a before and after using the australia news payload (which is a worst case)
Before

After

Checklist
data/databasefiles generated by tests are committed with this PR (the tests will fail in CI if you've forgotten to do this) => does not apply