Introduce explicit caching #87

Open
opened 2025-01-18 17:23:46 +01:00 by nik · 1 comment
nik commented 2025-01-18 17:23:46 +01:00 (Migrated from edugit.org)

We have removed django-cachalot from AlekSIS, and have historically been relying on SQL query caching for computationally heavy operations.

Instead, we should now introduce explicit caching, in two steps:

  1. Introduce explicit caching for all computations in the backend. This should be comprised of two parts:
    1. Explicit cache retrieval, update and invalidation for code parts that work with volatile data
    2. LRU caching / memoizing of methods that always return stable results for the same arguments
  2. Efficiently use cache keys in the frontend. This is a bit tricky as we have blocked the path to use standard HTTP caching mechanisms, like Last-Modified or the ETag, with the decision to rely on GraphQL.

In any case, we should still ensure that code returning data and responses can already generate stable ETags.

We have removed django-cachalot from AlekSIS, and have historically been relying on SQL query caching for computationally heavy operations. Instead, we should now introduce explicit caching, in two steps: 1. Introduce explicit caching for all computations in the backend. This should be comprised of two parts: 1. Explicit cache retrieval, update and invalidation for code parts that work with volatile data 2. LRU caching / memoizing of methods that always return stable results for the same arguments 2. Efficiently use cache keys in the frontend. This is a bit tricky as we have blocked the path to use standard HTTP caching mechanisms, like `Last-Modified` or the `ETag`, with the decision to rely on GraphQL. In any case, we should still ensure that code returning data and responses can already generate stable ETags.
nik commented 2025-01-18 17:36:48 +01:00 (Migrated from edugit.org)
Something that might be worth reading: https://www.apollographql.com/blog/graphql-caching-the-elephant-in-the-room
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS#87
No description provided.