Marcus Christie created AIRAVATA-3273:
-----------------------------------------
Summary: webpack-stats.json not getting cached
Key: AIRAVATA-3273
URL: https://issues.apache.org/jira/browse/AIRAVATA-3273
Project: Airavata
Issue Type: Bug
Components: Django Portal
Reporter: Marcus Christie
Assignee: Marcus Christie
By default, [django-webpack-loader caches
webpack-stats.json|https://github.com/owais/django-webpack-loader#cache] when
DEBUG is false, but
- it only does this on demand, so if there have no requests to the workspace
app, it won't have cached [the WORKSPACE webpack loader
config|https://github.com/apache/airavata-django-portal/blob/master/django_airavata/settings.py#L328]
- currently the Ansible deployment configures mod_wsgi to start two Django
processes, so even in the portal has seen a request for a Django app and cached
that webpack loader config, that would only apply to the process that handled
that request and the other one may not have it cached
This causes a problem during deployment because the webpack-stats.json file
gets updated well before {{collectstatic}} runs to copy the JS/CSS files into
the static/ folder.
Here are some ideas on how to improve this situation:
- only have 1 Django process. That's the default, and we can increase it on a
gateway by gateway basis if we actually see the kind of load that would warrant
it.
- somehow trigger a load of the webpack loader assets on server startup so they
are cached on startup. Maybe in AppConfig.ready()
--
This message was sent by Atlassian Jira
(v8.3.4#803005)