feat(backend): add redis distributed caching layer (fixes #178)#187
Open
Diwakar-odds wants to merge 1 commit into
Open
feat(backend): add redis distributed caching layer (fixes #178)#187Diwakar-odds wants to merge 1 commit into
Diwakar-odds wants to merge 1 commit into
Conversation
Author
|
Hi maintainers, Thank you for assigning this issue to me. I have implemented the Redis caching layer as specified. Technical Analysis
ECSoC26 XP Label RequestBased on the ECSoC '26 Guidelines, this PR falls squarely into the Level 3 (Core/Arch/Perf) category since it involves a core architectural upgrade (adding a distributed caching system) that directly optimizes performance and scalability. Could you please add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #178
Summary
Introduced a Redis distributed caching layer to cache Google Safe Browsing API responses, significantly reducing external API quotas and latency for redundant scans.
Motivation
Closes #178
Every URL check previously required a full round-trip to the Google Safe Browsing API. Adding a caching layer (Redis) saves processing time, reduces latency, and protects our API quota by directly serving recently scanned results.
Changes Made
server.js:redisclient./checkrequests to fetch cached responses before pinging the external API.package.json&package-lock.json: Addedredis(v4) dependency.README.md: Added setup instructions for the new optionalREDIS_URLenvironment variable.Acceptance Criteria
Impact & Side Effects
Testing
REDIS_URLin.env(e.g.,REDIS_URL=redis://localhost:6379).npm start.example.com). Observe the[SCAN]log.[CACHE HIT] example.comlog instead of a new API call.Checklist