Overview
As our Academic Resource Hub grows, fetching the full list of study materials directly from MongoDB for every user will cause unnecessary load on our database and increase latency. We should implement a caching layer using Redis for our high-traffic GET endpoints.
Objectives
- Set up a Redis instance (can use Upstash for serverless or local Docker for dev).
- Implement an Express middleware caching layer for
GET /api/resources and GET /api/notices.
- Implement cache invalidation strategies: when a teacher adds/edits/deletes a resource, the relevant Redis cache keys must be cleared.
Technical Requirements
- Node.js, Express,
redis or ioredis.
Acceptance Criteria
Overview
As our Academic Resource Hub grows, fetching the full list of study materials directly from MongoDB for every user will cause unnecessary load on our database and increase latency. We should implement a caching layer using Redis for our high-traffic
GETendpoints.Objectives
GET /api/resourcesandGET /api/notices.Technical Requirements
redisorioredis.Acceptance Criteria
GETrequest retrieves data from MongoDB and saves it to Redis.GETrequests return data from the Redis cache (should see massive speed improvements in response headers).