Skip to content

Strip commercial tag properties for DCR tag pages - #28964

Draft
jorgeazevedo wants to merge 2 commits into
mainfrom
ja-strip-commercial-tag-pages
Draft

Strip commercial tag properties for DCR tag pages#28964
jorgeazevedo wants to merge 2 commits into
mainfrom
ja-strip-commercial-tag-pages

Conversation

@jorgeazevedo

@jorgeazevedo jorgeazevedo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What is the value of this and can you measure success?

Applies withoutCommercial stripping 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[].properties has 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 FETagType except for commercial.

As it happens, commercial accounts for 60% to 70% of the size of the total size of the DCR payload, and given it's not in FETagType it 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 main and from this PR by

Deploying main to CODE and running

curl -s 'https://m.code.dev-theguardian.com/tone/minutebyminute.json?dcr=true' -o minute-code.json
curl -s 'https://m.code.dev-theguardian.com/tone/minutebyminute+australia-news/australia-news.json?dcr=true' -o australia-code.json
curl -s 'https://m.code.dev-theguardian.com/profile/josh-taylor.json?dcr=true&page=8' -o profile-code.json

Deploying this PR to CODE and running

curl -s 'https://m.code.dev-theguardian.com/tone/minutebyminute.json?dcr=true' -o minute-trimmed.json
curl -s 'https://m.code.dev-theguardian.com/tone/minutebyminute+australia-news/australia-news.json?dcr=true' -o australia-trimmed.json
curl -s 'https://m.code.dev-theguardian.com/profile/josh-taylor.json?dcr=true&page=8' -o profile-trimmed.json

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.html and made sure I got the same exact number of bytes per html file both the trimmed and non-trimmed version of the JSON.

URL main JSON HTML from DCR PR JSON HTML from DCR
/tone/minutebyminute.json?dcr=true 651KB 336,554 bytes 227KB (−65%) 336,554 bytes
/tone/minutebyminute+australia-news/australia-news.json?dcr=true 1.1MB 289,505 bytes 362KB (−68.5%) 289,505 bytes
/profile/josh-taylor.json?dcr=true&page=8 829KB 348,071 bytes 281KB (−66%) 348,071 bytes

Performance 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
Screenshot 2026-08-15 at 20 19 58

After
Screenshot 2026-08-15 at 20 20 25

Checklist

@jorgeazevedo jorgeazevedo added performance maintenance Departmental tracking: maintenance work, not a fix or a feature labels Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@jorgeazevedo
jorgeazevedo force-pushed the ja-strip-commercial-tag-pages branch from 535883c to af4e850 Compare August 14, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant