Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[performance]: make s3 urls cacheable #1194

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

theSuess
Copy link
Contributor

@theSuess theSuess commented Dec 1, 2022

Implements #864 and should speed up s3 based installations by a lot.

With more static URL, we can then also implement #1026 for even better performance when used in conjunction with CDNs

I hope that I used the cache library correctly - oriented myself on the eTagCache

(Also tweaked the testrig to use the actual storage implementation for building the S3 config)

"codeberg.org/gruf/go-store/v2/kv"
"codeberg.org/gruf/go-store/v2/storage"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/superseriousbusiness/gotosocial/internal/config"
)

const (
urlCacheTTL = time.Hour * 24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be configurable, but I'm not too sure if it is actually that useful

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have many configuration options we mean to sort-out in time. We can leave it until then :')

Implements superseriousbusiness#864 and should speed up s3 based installations by a lot.

With more static urls, we can then also implement superseriousbusiness#1026 for even
better performance when used in conjunction with CDNs
@tsmethurst
Copy link
Contributor

this looks OK to me if you're both happy with it :)

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit bc917a4 into superseriousbusiness:main Dec 2, 2022
@superseriousbusiness superseriousbusiness deleted a comment Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants