learningequality / learningequality/studio

Utilities to clear recommendations cache

Open
#5,565 1 comment 0 reactions 1 assignee View on GitHub

@bjester is already working on this.

Since May 11, 2026.

DEV: backend P1 - important TAG: new feature TAG: performance
Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Current behavior

When Studio queries the Curriculum Automation API for recommendations, it caches the results in a table defined by the model RecommendationsCache. If a channel in the Kolibri Content Library (a public channel) changes and is republished, new recommendations could be applicable and old recommendations could be invalid.

Desired behavior

  • A Django management should be created that:
    • should delete all data from the RecommendationsCache
  • A utility function should be created that:
    • should accept a channel_id as an argument
    • should find all request_hash that have records with a matching channel_id
    • should delete all records with those request_hash
    • should be called during channel publishing, for that channel, when delete_public_channel_cache_keys() is called

Value add

  • Allows us to do targeted cache clearing for prior recommendation requests that had recommendations from recently updated and published channels
  • Allows us to do full cache clearing on a schedule, which will allow matching new recommendations for content that wasn't previously recommended

Possible tradeoffs

  • Ideally, we release performance improvement prior to doing more aggressive cache clearing
  • Targeted cache clearing doesn't cover all situations and may not be worthwhile long-term, but probably worthwhile until we better understand our performance limitations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.