gravatar_34 is inefficient and never used
Categories
(developer.mozilla.org Graveyard :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: peterbe, Assigned: peterbe)
Details
(Keywords: in-triage)
Attachments
(1 file)
Take the Document JSON API. It puts together a document structure which contains a list of contributor usernames. E.g.
{"title": "My Document Title",
"contributors": ["peterbe", "schalk", "ryan"],
...
The DocumentContributorsJob.get(doc.pk) is called from kuma.api.v1.views.document_api_data which in term triggers gravatar_url() which triggers using UserGravatarURLJob().get() for each contributor based on their email.
First of all, we're never even bothering with using this gravatar_34 in the response, we're apparently not using it anywhere in the whole code base:
▶ rg gravatar_34
kuma/wiki/jobs.py
57: contributor['gravatar_34'] = gravatar_url(contributor['email'],
Getting rid of it will massively reduce the amount of Redis cache GET commands we send. Roughly, I estimate for a page with X contributors we cause X calls to cache.get().
| Assignee | ||
Comment 1•7 years ago
|
||
I don't think this'll clash with the efforts in https://github.com/mozilla/kuma/pull/5546
Comment 2•7 years ago
|
||
So, the reason we have gravatar code is because a while back, we had a requirement at one point to create a more visual and more rewarding "Recent contributors" bar at the top of the page, that would include the gravatars for those contributors.
It was actually really a beautiful feature, and was I think popular, but it was built over a weekend as a hackathon project and was not performing well, so it got disabled, and never got finished despite being on the priority list.
Comment 3•7 years ago
|
||
See bug 1177797 and bug 1012698 for further details and a screenshot or two.
Comment 4•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
We removed it.
Updated•6 years ago
|
Description
•