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

feat: upload br encoding to asset canister #3791

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

sesi200
Copy link
Contributor

@sesi200 sesi200 commented Jun 13, 2024

Description

Asset synchronization now not only uploads identity and gzip as encodings for MIME types text, js, and html, but also br encoding.

Fixes SDK-1604

How Has This Been Tested?

Added e2e

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@sesi200 sesi200 marked this pull request as ready for review June 13, 2024 13:54
@sesi200 sesi200 requested a review from a team as a code owner June 13, 2024 13:54
@@ -370,7 +370,9 @@ fn content_encoding_descriptive_suffix(content_encoding: &str) -> String {
// todo: make this configurable https://github.com/dfinity/dx-triage/issues/152
fn applicable_encoders(media_type: &Mime) -> Vec<ContentEncoder> {
match (media_type.type_(), media_type.subtype()) {
(mime::TEXT, _) | (_, mime::JAVASCRIPT) | (_, mime::HTML) => vec![ContentEncoder::Gzip],
(mime::TEXT, _) | (_, mime::JAVASCRIPT) | (_, mime::HTML) => {
vec![ContentEncoder::Gzip, ContentEncoder::Brotli]

Choose a reason for hiding this comment

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

Has this been discussed, as a default behavior, at the product level?

I think it would be better to opt-in, configured in .ic-assets.json

Choose a reason for hiding this comment

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

sns-controlled asset canisters might impossible to sync unless they can opt-in for a subset of files rather than all at once. This is because a proposal's commit by definition has to be a single call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be adjusted once #3792 is merged

@sesi200 sesi200 merged commit 5ee2a1c into master Jun 19, 2024
289 checks passed
@sesi200 sesi200 deleted the SDK-1604-add-brotli-compression-to-asset-sync branch June 19, 2024 08:16
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.

2 participants