Teammates: Reduce number of profile pic requests

Created on 2 May 2017  路  9Comments  路  Source: TEAMMATES/teammates

v5.102

image

It appears there is a high number of page/ProfilePic requests, which outnumber all other type of requests. This is unexpected because more students don't even have profile pics. Any request to load a pic should be initiated by the user clicking on a 'show picture' link manually. We need to find the origin of these requests and rewrite the code to minimize unnecessary requests.

a-Performance p.Medium

All 9 comments

The request referer header contains the URL of the requesting page. Are the headers captured in the logs? If not, can also see which page request usually precedes it.

No it is not captured by logs. hard to see a pattern in the logs.

image

Maybe can try filtering by IP and user agent to narrow the logs down to a single user session? Expand protoPayload, click on ip and select Show matching entries; do the same for userAgent:
screen shot 2017-05-29 at 5 29 09 pm

I checked 3 cases. All seem to result from studentCourseDetails page (i.e. student viewing team details). However, I'm not sure if the number of requests is correct. For example, this guys has only 5 members in his team but there are about 50 profile pic requests from one page request to view team.
image

Only a few of the URLs are unique. I believe the culprit here is the browser's mechanism for quicker loading of page elements - when it doesn't receive a response within a certain amount of time, it opens another (or several other) connection(s) in parallel to request the same URL, then uses the fastest response. It might have been caused by (i) our profile picture action responding slower than before, and/or (ii) a recent browser update decreasing the threshold value before parallel requests are fired off.

I see. Perhaps we can modify the page to show 'show picture' link instead? The picture can be loaded only if the link is clicked. A better approach is to not show the picture (or the link) if the student has no profile picture but not sure how much work that takes.

Are there still a lot of profile pic requests? Wondering if #7477 affects this in any way.

Seems to be fixed now. No high number of profile pic requests in the last 24 hours.

Should this be closed, then?

Was this page helpful?
0 / 5 - 0 ratings