Cached attachments

This commit is contained in:
LittleSheep 2024-02-18 19:54:56 +08:00
parent ed578ec315
commit 9986fb0b9c

View File

@ -67,7 +67,10 @@ func NewServer() {
api.Get("/users/:accountId/follow", auth, getAccountFollowed) api.Get("/users/:accountId/follow", auth, getAccountFollowed)
api.Post("/users/:accountId/follow", auth, doFollowAccount) api.Post("/users/:accountId/follow", auth, doFollowAccount)
api.Get("/attachments/o/:fileId", openAttachment) api.Get("/attachments/o/:fileId", cache.New(cache.Config{
Expiration: 365 * 24 * time.Hour,
CacheControl: true,
}), openAttachment)
api.Post("/attachments", auth, uploadAttachment) api.Post("/attachments", auth, uploadAttachment)
api.Get("/posts", listPost) api.Get("/posts", listPost)