I have an django 1.1.1 app, actually in developement, thinking in best practices I ran the YSlow test (Grade E Ruleset applied: YSlow V2 ) it recomends:
Grade F on Add Expires headers
-There are 37 static components without a far-future expiration date.
Grade F on Use a Content Delivery Network (CDN)
-There are 37 static components that are not on CDN.
Grade F on Compress components with gzip
-There are 17 plain text components that should be sent compressed
How can I implement it with Django?
More context: Python 2.5, deployment at webfaction
Example:
Grade F on Make fewer HTTP requests
This page has 14 external Javascript scripts. Try combining them into one.
This page has 4 external stylesheets. Try combining them into one.Can be solved with Django-Compress
Of the three you listed, two are addressable at the web-server level. For example, in Linux/Apache:
For gzip, edit /etc/apache2/mods-available/deflate.conf
For Expires headers, first you need to enable mod_expires:
Then you need to configure it for the MIME types you want:
Writeup on why I recommend 12 hours here.
The last item (CDN) is typically something you outsource to someone like Akamai. It’s also quite expensive.