Skip to main content

Domain sharding for Django static files.

Project description

.. image::

Domain sharding for Django static files.

.. image::

.. image::

.. image::

``django-staticshard`` provides a set of utilities to easily enable domain sharding of static files in your Django project.

It comes with a storage backend, a tempalatetag, and a middleware (you may use one or all).

What is Domain Sharding?

Domain sharding is a technique used to accerate the time it takes for a webpage to render in a browser. Web browsers will only open a small number of parallel connections to each domain (~2-16). The theory is that if your webpage contains a lot of external assets from a single domain, you may experience a bottleneck while the browser wait for files to download before making the next request. Spreading these requests across multiple domains will allow more files to be downloaded in parallel, thus accelerating the page render time. Of course, each new domain incur the cost of a DNS lookup... so there is a balance to be struck.

Read what Google has to say about it.

Why are you doing this?

Domain sharding is a science, not an art. But there is reliable no formula for it. In certain cases it has no impact on page speed. In others, the effects may be significant. In addition, determining the ideal number of domains needs to take into account a variety of factors.
In order to determine whether sharding even makes sense, it would be helpful

I felt that in order to make informed decisions about domain sharding, one must able to easily test it's impact in multiple configurations. So a tool that makes it easy to implement domain sharding is desirable.

Read The Docs

Project details

Release history Release notifications

This version
History Node


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page