Skip to main content

A collection of stuff to improve django web performance.

Project description

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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-webperf-0.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file django-webperf-0.1.tar.gz.

File metadata

File hashes

Hashes for django-webperf-0.1.tar.gz
Algorithm Hash digest
SHA256 cf24c92c4b4ad34d2653d9e6a90f4b8bfdda5b898a9a51589247ad2f82e6c602
MD5 7a129d3ab475a643cc0ea1755fa1a62e
BLAKE2b-256 5562fa443ed31f2f3cc17c782bd3edcc29db30b755087c0291147cde1040101b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page