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

AssetSync and Cloudfront don't agree on what mimetype js files ought to have #373

Closed
nevinera opened this issue Oct 20, 2018 · 3 comments
Closed
Assignees

Comments

@nevinera
Copy link

We suddenly realized today that our production javascript files are not being served compressed by CloudFront - when we dug in, we noticed that they were now getting the Content-Type metadata value 'application/ecmascript'. That appears to be intended - AssetSync is pulling in the mime-types gem, which is using this data to determine appropriate types.

Sadly, Cloudfront does not consider "application/ecmascript" to be a compressible content-type, and just serves those files uncompressed.

Is this something you are already aware of? What's your recommended solution? MimeTypes doesn't give any good interface for overriding known Content-Types, we're currently monkey-patching your MultiMime.fetch method and intercepting requests about the js extension.

@PikachuEXE
Copy link
Member

It seems there are several types matched by the extension name
Let me add an option to allow overriding file extension name to mime type mapping

@PikachuEXE PikachuEXE self-assigned this Oct 22, 2018
@nevinera
Copy link
Author

That sounds ideal - it's exactly what we went looking for first once we understood the problem. I'm also a little concerned about how hard it is for anyone to notice that they're being affected, but I don't have any good answers for that in mind :-\

@PikachuEXE
Copy link
Member

@nevinera
Please take a look at #374 to see if it looks fine for you :)

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

No branches or pull requests

2 participants