Gravatar icons are not cache friendly #12021

Closed
opened 2025-11-02 09:54:51 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @otbutz on GitHub (Nov 15, 2023).

Description

Opening a pull request in Firefox is always delayed by profile image requests if Gravatar is enabled. The requests to secure.gravatar.com are unproblematic as they hit the browser cache. The problem seems to be caused by the indirection to giteas /avatar endpoint which answers with HTTP 303:

Bildschirmfoto vom 2023-11-15 15-34-15

The behaviour is fully reproducible on every page reload. The gitea /avatar requests are always sent to the backend and never hit the browser cache.

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary started via systemd behind a caddy reverse proxy.

Database

None

Originally created by @otbutz on GitHub (Nov 15, 2023). ### Description Opening a pull request in Firefox is always delayed by profile image requests if Gravatar is enabled. The requests to `secure.gravatar.com` are unproblematic as they hit the browser cache. The problem seems to be caused by the indirection to giteas `/avatar` endpoint which answers with HTTP 303: ![Bildschirmfoto vom 2023-11-15 15-34-15](https://github.com/go-gitea/gitea/assets/22315436/d5c174da-b1dc-49f3-b435-9f09e94210dc) The behaviour is fully reproducible on every page reload. The gitea `/avatar` requests are always sent to the backend and never hit the browser cache. ### Gitea Version 1.21.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Binary started via systemd behind a caddy reverse proxy. ### Database None
GiteaMirror added the type/bug label 2025-11-02 09:54:51 -06:00
Author
Owner

@otbutz commented on GitHub (Nov 17, 2023):

The extreme slowdown was apparently caused by DNS issues:

Nov 17 13:57:22 git gitea[2907929]: 2023/11/17 13:57:22 ...ls/avatars/avatar.go:117:LibravatarURL() [E] LibravatarService.FromEmail(email=xxxxx@localhost): error lookup _avatars-sec._tcp.localhost on 127.0.0.53:53: read udp 127.0.0.1:48896->127.0.0.53:53: i/o timeout
@otbutz commented on GitHub (Nov 17, 2023): The extreme slowdown was apparently caused by DNS issues: ``` Nov 17 13:57:22 git gitea[2907929]: 2023/11/17 13:57:22 ...ls/avatars/avatar.go:117:LibravatarURL() [E] LibravatarService.FromEmail(email=xxxxx@localhost): error lookup _avatars-sec._tcp.localhost on 127.0.0.53:53: read udp 127.0.0.1:48896->127.0.0.53:53: i/o timeout ```
Author
Owner

@otbutz commented on GitHub (Nov 17, 2023):

Related: #6046

@otbutz commented on GitHub (Nov 17, 2023): Related: #6046
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12021