Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove need to run collectstatic by using WhiteNoise to serve assets directly from their static directories #7792

Closed
rtibbles opened this issue Feb 15, 2021 · 1 comment
Assignees
Labels
TAG: performance User-facing performance

Comments

@rtibbles
Copy link
Member

Observed behavior

We currently have to run collectstatic in order to move all static files into a single location. This makes an upfront startup cost, and occasionally means that incorrect static files are available.

We have already added a small workaround to make symbolic links instead of copying files to reduce disk space impact on some platforms.

Expected behavior

We should read and serve static files directly from their directories to avoid having to run collect static.

Possible implementations:

  • Use the WhiteNoise Django Middleware to serve static files
  • Replicate the finders mapping behaviour at startup to build the static files map from the WhiteNoise Django middleware, but keep serving static files from the top level WSGI application, so we avoid Django overhead for static file serving

Open Questions:

  • For serving from behind Nginx, we could either just proxy the static endpoint and let Nginx's caching handling serve up the file after it has first been requested
  • Alternatively, we could require that servers using Nginx still run collectstatic and serve the files directly

User-facing consequences

  • Smaller space requirements.
  • No issues with static files not updating.
  • Faster startup times on upgrade.

Needs #7791 as a prerequisite

@rtibbles
Copy link
Member Author

Fixed in #7920

dylanmccall added a commit to flathub/org.learningequality.Kolibri that referenced this issue Aug 25, 2022
This setting has been dropped since Kolibri 0.15.0 and is currently a
no-op.

learningequality/kolibri#7792
dylanmccall added a commit to learningequality/kolibri-installer-gnome that referenced this issue Aug 25, 2022

This setting has been dropped since Kolibri 0.15.0 and is currently a
no-op.

learningequality/kolibri#7792
dbnicholson pushed a commit to dbnicholson/kolibri-installer-gnome that referenced this issue Aug 23, 2023
This setting has been dropped since Kolibri 0.15.0 and is currently a
no-op.

learningequality/kolibri#7792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TAG: performance User-facing performance
Projects
None yet
Development

No branches or pull requests

2 participants