Closed Bug 1567572 Opened 7 years ago Closed 7 years ago

gravatar_34 is inefficient and never used

Categories

(developer.mozilla.org Graveyard :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

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().

I don't think this'll clash with the efforts in https://github.com/mozilla/kuma/pull/5546

Assignee: nobody → peterbe

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.

See bug 1177797 and bug 1012698 for further details and a screenshot or two.

Keywords: in-triage

We removed it.

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: