Comments (3)
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.
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.
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)
- Include CSS with cache-busting filename? HOT 4
- Rhino often runs out of stack HOT 2
- REQUIRE_EXCLUDE setting doesn't work files deeper in path HOT 1
- "removeCombined" build profile setting has no effect HOT 1
- Update resources HOT 2
- Can't set REQUIRE_BASE_URL to empty string (aka exactly STATIC_ROOT) HOT 2
- I want to get build.txt output of r.js optimizer HOT 2
- Error running collect static with OptimizedCachedStaticFilesStorage HOT 5
- OptimizedCachedStaticFilesStorage and changing files names HOT 1
- Clash with django-pipeline? HOT 6
- management command just to build the standalone modules HOT 5
- add async attribute to the tag HOT 1
- Variable REQUIRE_BASE_URL for standalone modules? HOT 17
- Output of require_module template tag gets escaped in Django 1.9 HOT 2
- Add paths to REQUIRE_EXCLUDE HOT 4
- Best practices for using django-require in multi-page apps HOT 2
- Reusing paths between standalone module and development server configuration HOT 6
- require_module template tag doesn't reference hashed file HOT 1
- django 1.11 build failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-require.