Gitea's avatar images are missing caching headers #312
Closed
opened 2021-02-25 18:42:17 +00:00 by raucao
·
1 comment
No Branch/Tag Specified
Labels
Clear labels
monitoring
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
service
discourse
Kosmos Community Forums
Infrastructure metrics, alerts, notifications, etc.
service
accounts
Kosmos Accounts
service
drone-ci
Kosmos Drone CI
service
email
mail.kosmos.org
service
garage
S3-compatible object storage
service
gitea
Kosmos Gitea
service
ipfs
Kosmos IPFS
service
mastodon
kosmos.social
service
nostr
Relays, Blossom server, etc.
service
postgres
Database cluster
service
remotestorage
Portable data storage for the Web
service
wiki
Kosmos Wiki
service
xmpp
Kosmos Chat
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#312
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Whenever I load a page on gitea.kosmos.org, it loads all images anew. Seems like the nginx host is missing config for static assets.
I had a look at this just now: normal static assets, like CSS files etc. carry
expiresandlast-modifiedheaders to at least cache them for 24 hours (albeit no ETAGs).Other uploaded custom files, e.g. file attachments, come with a
cache-control: public,max-age=86400, which also does what it's supposed to.However, uploaded avatars specifically, both user/org and repo ones (which live in two different folders on the disk), are missing any and all caching headers.
So I think this should be fixed in Gitea itself. Otherwise we'll have to change permissions on the uploaded avatars, or add the nginx user to thegitgroup, which seems like a bad idea to me.I missed the obvious choice of using a regex location directive for adding custom caching headers for anything in the avatar folders. See PR.
Gitea's static assets like avatars not cachedto Gitea's avatar images are missing caching headers