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

Disabling gzip compression in cloudfront's cache option. #373

Conversation

fvsnippets
Copy link

@fvsnippets fvsnippets commented Jun 18, 2022

There's no need to enable gzip in the cloudfront's cache policy.

Current cache policy, enables gzip compression which in turn adds the "accept-encoding" header to the cache key. But origin (resizing lambda) won't use it (am I missing something?) which makes sense because we are working with already compressed image-formats.
Notice that cloudfront enables auto compression only on image/svg+xml (see this) which also makes sense.
So, with current cache policy, two almost "equivalent" requests (from cloudfront's cache key perspective), except for the accept-encoding: gzip header presence, will generate different entries on the cache.

Please read this: "Remove Accept-Encoding header when compression is not needed".

I am disabling gzip compression on cloudfront's cache policy. This change will improve the cloudfront's cache hit ratio.

Issue #, if available:

#304

Description of changes:

Switching off gzip compression on cloudfront's cache policy.

Tests were updated to reflect changes.

Checklist

  • 👋 I have run the unit tests, and all unit tests have passed.
  • ⚠️ This pull request might incur a breaking change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@fisenkodv
Copy link
Contributor

@fvsnippets thank you for your contribution. We will look into it and add it to our backlog.

@karensg
Copy link

karensg commented Sep 21, 2022

Hey @fisenkodv, do you have an idea when we should expect a new release? Would love to have this merged.

@G-Lenz
Copy link
Contributor

G-Lenz commented Sep 21, 2022

Hi @karensg
We do not currently have a timeline for this but we do have it on our backlog and are looking into adding it into a future release.

@github-actions
Copy link

This pr has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the Stale label Dec 21, 2022
@fvsnippets
Copy link
Author

This pr has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Keeping it open.

@github-actions github-actions bot removed the Stale label Dec 22, 2022
@github-actions
Copy link

This pr has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@fvsnippets fvsnippets force-pushed the disabling-gzip-compression-on-cache-policy branch from f1c048b to 1abf830 Compare October 8, 2023 04:01
@fvsnippets
Copy link
Author

Updated with current main branch (using rebase). Conflicts were resolved.

@dougtoppin
Copy link
Contributor

@fvsnippets Thanks for your suggestion and submission. We have been discussing it and are planning on including the change in an upcoming release.

@dougtoppin
Copy link
Contributor

addressed with v6.2.4

@dougtoppin dougtoppin closed this Dec 15, 2023
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.

5 participants