Skip to main content

Django Web Performance

A collection of stuff to improve django web performance.

Domain sharding

Domain sharding is an optimization technique for parallelization of resource loading. If you have a lot of media files on your page you might want them to be downloaded from different domains, as web browsers have limits on how many files they can grab at once. Domain sharding reduces the overall page load time and is widley used on rich media sites, like Facebook, Youtube, etc.

It works as a customized django file storage, overriding standard url method.

Installation & setup

Recommended way to install is pip:

pip install django-webperf

Make sure to change your DEFAULT_FILE_STORAGE in settings.py to use sharding site-wide:

DEFAULT_FILE_STORAGE = 'web_performance.storage.DomainShardingStorage'

Settings

WEBPERF_MEDIA_TEMPLATE

Default:

'' (empty string)

A pattern to generate media_urls with a standard format placeholder. E.g. http://img{0}.example.com/media/

WEBPERF_DOMAINS_NUMBER

Default:

2

Number of domains you want to use to split your media content.

Don’t use too many domains, becasue it will increase DNS lookup time.

Metadata

Release files for django-webperf 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-webperf 0.1
File Size Uploaded
django-webperf-0.1.tar.gz 4.0 kB Details

Release files / django-webperf-0.1.tar.gz

Download URL django-webperf-0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cf24c92c4b4ad34d2653d9e6a90f4b8bfdda5b898a9a51589247ad2f82e6c602
BLAKE2b-256 checksum
How to use checksums
5562fa443ed31f2f3cc17c782bd3edcc29db30b755087c0291147cde1040101b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page