[Enhance Performance with Optimizations and Caching] - Added Caching and Polling#107
[Enhance Performance with Optimizations and Caching] - Added Caching and Polling#107tulu-g559 wants to merge 1 commit intosristy17:dwoc-2025from
Conversation
sristy17
left a comment
There was a problem hiding this comment.
Great job, @tulu-g559! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our contributing guidelines
|
@sristy17 |
app crashed?? |
pooranjoyb
left a comment
There was a problem hiding this comment.
I see no point to implement caching in these two functionalities.
@sristy17 Anything to add?
| import connectDatabase from './database/Mongo.database.js'; | ||
| import sessions from 'express-session'; | ||
|
|
||
| const express = require('express'); |
There was a problem hiding this comment.
The entire project is based on mjs architecture. Please update this.
| headers: { | ||
| 'Content-Type': 'application/json' | ||
| } | ||
| redisClient.setex(cacheKey, 3600, JSON.stringify(response.data.candidates[0].content.parts[0].text)); |
There was a problem hiding this comment.
SETEX is deprecated. Please upgrade.
| contents: [ | ||
| { | ||
| parts: [ | ||
| const cacheKey = `mood_${scale}`; |
There was a problem hiding this comment.
I didn't get your point here. The sole purpose of caching is to reduce the api calls, not to cache whatever you want. Please understand the concepts before implementing something. Here, the mood is dynamic and it will fetch different responses based on different moods selected. Why is there a need to cache? @tulu-g559
| contents: [ | ||
| { | ||
| parts: [ | ||
| const cacheKey = `tasks_${scale}`; |
There was a problem hiding this comment.
Same thing here, no point to cache where responses are dynamic.
In situations where the data changes frequently or is user-specific, caching doesn't provide much benefit.
@tulu-g559
Fixes Issue
#106
Changes proposed
Check List (Check all the applicable boxes)
Screenshots
Note to reviewers
Please review the caching and polling mechanisms for any potential improvements or optimizations.