Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Cache waveform data #490

Closed
1 task
sarayourfriend opened this issue Jan 31, 2022 · 1 comment · Fixed by #510
Closed
1 task

Cache waveform data #490

sarayourfriend opened this issue Jan 31, 2022 · 1 comment · Fixed by #510
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature good first issue New-contributor friendly help wanted Open to participation from the community 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work

Comments

@sarayourfriend
Copy link
Contributor

Problem

Fetching waveform data from the API currently generates the waveform on every hit.

Description

This should be cached to only be calculated the first time the waveform for an audio is requested.

We can use any caching strategy we want, but it'll have to be cached on disk rather than memory (I would think) to avoid filling up RAM and forcing the main application processes to use swap. Could we just cache it directly in the DB?

Django supports many caching strategies that allow using the Django provided cache object: https://docs.djangoproject.com/en/4.0/topics/cache/

Additional context

Implementation

  • 🙋 I would be interested in implementing this feature.
@sarayourfriend sarayourfriend added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Jan 31, 2022
@AetherUnbound
Copy link
Contributor

We're actually already using a cache for a few other things in the API! https://github.com/WordPress/openverse-api/blob/main/api/catalog/settings.py#L154

It should be fairly straightforward to add the waveforms to that cache as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature good first issue New-contributor friendly help wanted Open to participation from the community 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants