Giter Club home page Giter Club logo

Comments (3)

etianen avatar etianen commented on July 17, 2024

Just set AWS_IS_GZIPPED = True in your settings.py. It's a feature of django-storages.

Happy coding!

On 9 Apr 2014, at 19:44, Chris [email protected] wrote:

My JS/CSS assets (which are served off of CloudFront are not being Gzipped). I am pushing the assets to S3 using:

class OptimizedCachedS3BotoStorage(FolderNameHackMixin, OptimizedFilesMixin, CachedFilesMixin, S3BotoStorage):
I've been reading up on it a bit, and it seems that if you need to gzip it before your push to cloudfront, remove the .gz part and set the content type to gzip on the asset in S3. This should obviously be handled automatically, but it seems crazy that the collectstatic pushing it to S3 doesn't handle it automatically. Any thoughts about how to integrate it or what setting is needed for this?


Reply to this email directly or view it on GitHub.

from django-require.

chrisdl avatar chrisdl commented on July 17, 2024

That's crazy that I haven't seen that! My move was this (which I saw somewhere else)

GZIP_CONTENT_TYPES = (
    'text/css',
    'application/javascript',
    'application/x-javascript',
    'text/javascript'
)

I'll try it with one and the other and report back.

from django-require.

chrisdl avatar chrisdl commented on July 17, 2024

Your way worked and mine didn't.

adding

AWS_IS_GZIPPED = True

to the settings.py file shaved 86% off the size of the css file! Aka, totally worth the added CPU to unzip it. Thanks for the help.

from django-require.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.