[PERF-303] Integer XBlocks/XModules into the static asset pipeline. This PR, based on hackathon work from Christina/Andy, implements a way to discover all installed XBlocks and XModules and to enumerate their public assets, then pulling them in during the collectstatic phase and hashing them. In turn, the methods for generating URLs to resources will then returned the hashed name for assets, allowing them to be served from nginx/CDNs, and cached heavily.
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""
|
|
Django storage backends for Open edX.
|
|
"""
|
|
from django_pipeline_forgiving.storages import PipelineForgivingStorage
|
|
from django.contrib.staticfiles.storage import StaticFilesStorage, CachedFilesMixin
|
|
from pipeline.storage import PipelineMixin, NonPackagingMixin
|
|
from require.storage import OptimizedFilesMixin
|
|
from openedx.core.djangoapps.theming.storage import ComprehensiveThemingAwareMixin
|
|
|
|
|
|
class ProductionStorage(
|
|
PipelineForgivingStorage,
|
|
ComprehensiveThemingAwareMixin,
|
|
OptimizedFilesMixin,
|
|
PipelineMixin,
|
|
CachedFilesMixin,
|
|
StaticFilesStorage
|
|
):
|
|
"""
|
|
This class combines Django's StaticFilesStorage class with several mixins
|
|
that provide additional functionality. We use this version on production.
|
|
"""
|
|
pass
|
|
|
|
|
|
class DevelopmentStorage(
|
|
ComprehensiveThemingAwareMixin,
|
|
NonPackagingMixin,
|
|
PipelineMixin,
|
|
StaticFilesStorage
|
|
):
|
|
"""
|
|
This class combines Django's StaticFilesStorage class with several mixins
|
|
that provide additional functionality. We use this version for development,
|
|
so that we can skip packaging and optimization.
|
|
"""
|
|
pass
|