Avatars uploaded to instance are not cached #1430

Closed
opened 2025-11-02 04:00:31 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @thehowl on GitHub (Jan 7, 2018).

Example when loading my try.gitea.io dashboard:

image

This leads to some pretty poor performance when loading the page. On multiple retries, avatars served from try.gitea.io directly are never cached - which is pretty bad. This seems to be an issue with macaron's static file server itself, since as far as I can tell it never e.g. checks for the ETag on the request - only sends it. There is also no Expires header, which would be pretty nice to set for at least some time (e.g. an hour).

The best way to go here to me seems to copy the static file serving function and suit it to Gitea's needs altogether - seeing as I doubt unknwon will merge PRs to macaron (due to his current inactivity)

Originally created by @thehowl on GitHub (Jan 7, 2018). Example when loading my try.gitea.io dashboard: ![image](https://user-images.githubusercontent.com/4681308/34651114-efcc659e-f3cb-11e7-9808-79565708038f.png) This leads to some pretty poor performance when loading the page. On multiple retries, avatars served from try.gitea.io directly are never cached - which is pretty bad. This seems to be an issue with macaron's static file server itself, since as far as I can tell it never e.g. checks for the ETag on the request - only sends it. There is also no Expires header, which would be pretty nice to set for at least some time (e.g. an hour). The best way to go here to me seems to copy the static file serving function and suit it to Gitea's needs altogether - seeing as I doubt unknwon will merge PRs to macaron (due to his current inactivity)
GiteaMirror added the type/enhancement label 2025-11-02 04:00:31 -06:00
Author
Owner

@ethantkoenig commented on GitHub (Jan 19, 2018):

FWIW, I have succeeded in making contribution to unknwon's repos in the past (https://github.com/go-macaron/macaron/pull/149, https://github.com/go-ini/ini/pull/115). Even if in the short-term we have to make the change to gitea, I do think we should ultimately try to add caching to macaron (which is where it really belongs)

@ethantkoenig commented on GitHub (Jan 19, 2018): FWIW, I have succeeded in making contribution to unknwon's repos in the past (https://github.com/go-macaron/macaron/pull/149, https://github.com/go-ini/ini/pull/115). Even if in the short-term we have to make the change to gitea, I do think we should ultimately try to add caching to macaron (which is where it really belongs)
Author
Owner

@thehowl commented on GitHub (Jan 20, 2018):

Fair enough. I've created an issue for it on the macaron repository: https://github.com/go-macaron/macaron/issues/152 should the owner come back, I'll be very glad to port over the feature there.

@thehowl commented on GitHub (Jan 20, 2018): Fair enough. I've created an issue for it on the macaron repository: https://github.com/go-macaron/macaron/issues/152 should the owner come back, I'll be very glad to port over the feature there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1430