61 captures
02 Mar 2014 - 03 Dec 2025
Oct NOV Dec
29
2020 2021 2022
success
fail

About this capture

COLLECTED BY

Collection: Common Crawl

Web crawl data from Common Crawl.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20211129214154/https://www.fullstackpython.com/static-content.html
 

Full Stack Python logoFull Stack Python
All topics | Blog | Supporter's Edition | @fullstackpython | Facebook | What's new?

Static Content






Some content on a website does not change and therefore should be served up either directly through the web server or a content delivery network (CDN). Examples include JavaScript, image, and CSS files.

Types of static content


Static content can be either assets created as part of your development process such as images on your landing page or user-generated content. The Django framework calls these two categories assets and media.

Content delivery networks


A content delivery network (CDN) is a third party that stores and serves static files. Amazon CloudFront, CloudFlare and Fastly, are examples of CDN services. The purpose of a CDN is to remove the load of static file requests from web servers that are handling dynamic web content. For example, if you have an nginx server that handles both static files and acts as a front for a Green Unicorn WSGI server on a 512 megabyte virtual private server, the nginx server will run into resource constraints under heavy traffic. A CDN can remove the need to serve static assets from that nginx server so it can purely act as a pass through for requests to the Green Unicorn WSGI server.

CDNs send content responses from data centers with the closest proximity to the requester.

Static Content Resources




Crushing, caching and CDN deployment in Django shows how to use django-compressor and a CDN to scale static and media file serving.



Using Amazon S3 to host your Django static files



CDNs fail, but your scripts don't have to



django-storages is a Django library for managing static and media files on services such as Amazon S3 and other content delivery networks.



RevSys has a nice article on a range of important static file optimizations such as setting cache headers, optimizing JavaScript and reducing the size of images.



Twelve folks with significant experience working on and with CDNs provide their perspectives in this piece: CDN experts on CDNs.



Serving Static Files from Flask with WhiteNoise and Amazon CloudFront looks at how to manage static files with Flask, WhiteNoise, and Amazon CloudFront.


Static content learning checklist




Identify a content delivery network to offload serving static content files from your local web server. I recommend using Amazon S3 with CloudFront as it's easy to set up and will scale to high bandwidth demands.



Update your web application deployment process so updated static files are uploaded to the CDN. 



Move static content serving from the www subdomain to a static (or similarly named) subdomain so browsers will load static content in parallel to www HTTP requests.


What's next for building your web app?





How can I cache repeated requests for better performance?
 




I want to learn more about app users via web analytics.
 




How do I automate server configuration and deployments?
 





Sponsored By


AssemblyAI logo
The most accurate speech-to-text API. Built for Python developers.





Table of Contents



1. Introduction 2. Development Environments 3. Data 4. Web Development 5. Deployment Hosting Servers Static Content CDNs Virtual Private Servers Linode DigitalOcean Lightsail Platform-as-a-Service Heroku PythonAnywhere AWS CodeStar Operating Systems Ubuntu macOS Windows FreeBSD Web Servers Apache HTTP Server Nginx Caddy WSGI Servers Green Unicorn (Gunicorn) mod_wsgi uWSGI Continuous Integration Jenkins GoCD Configuration Management Ansible Salt Containers Docker Kubernetes Serverless AWS Lambda Azure Functions Google Cloud Functions 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.



Full Stack Python


Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.

Updates via Twitter & Facebook.



Chapters



1. Introduction 2. Development Environments 3. Data 4. Web Development 5. Deployment » Static Content 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.

 



Matt Makai 2012-2021