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: automatic compression #81
Comments
As an alternative, I would potentially suggest that the compression is done outside of serverless-finch by another build/tooling process. There are too many options that would probably need to be considered as to how to configure the compression, plus lots of various compression implementations to choose from. For example, I was able to quickly accomplish this using a couple of well supported webpack plugins:
This will output a copy of the uncompressed files both in gzip and brotli format, with That said, there is still the problem with serverless-finch. The new compression file suffixes will break the mime lookup logic. I was suddenly dealing with the prospect of creating dozens of rules for each compression + file-type (ie css vs js vs png vs..etc). Came up with a potential solution that I could turn into a PR if anyone is interested. This helper function will use the existing mime lookup library used by serverless-finch and will return the appropriate content-encoding header as well.
|
There seems to be a little bit of activity in this repo again, so I'm revisiting this after a long absence. I rebased my PR #109 and fixed merge conflicts. I also added those README changes promised. Is this a feature we'd like in this repo? I've been using this myself for a while now using my fork. I'd love to get this contributed upstream. |
This is a:
For feature requests or changes:
Current behavior (if any)
Specified files are uploaded as-is.
Proposed behavior
Option to compress before sending.
Justification
I turn off manage resources because I'm already creating the bucket in the serverless.yml. serverless-finch is very useful to specify a source directory and move only those files. Can an option be added to pre-compress the files, deal with what headers need to be dealt with?
I guess you'd want to support gzip and brotli
The text was updated successfully, but these errors were encountered: