You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (Jira)" <ji...@apache.org> on 2019/11/15 21:44:00 UTC

[jira] [Commented] (AIRAVATA-3273) webpack-stats.json not getting cached

    [ https://issues.apache.org/jira/browse/AIRAVATA-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975424#comment-16975424 ] 

Marcus Christie commented on AIRAVATA-3273:
-------------------------------------------

I think the change in deployment where the files are transfered via rsync is causing the wsgi.py to be updated and triggering a reload. So the Django process is reloading before collectstatic.  May need to exclude wsgi.py from the rsync transfer and then transfer it after collectstatic.

> 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
>            Priority: Major
>
> 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)