Skip to content

refactor(phishing-controller): enhance URL validation and caching in … #5688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 22, 2025

Conversation

AugmentedMode
Copy link
Contributor

@AugmentedMode AugmentedMode commented Apr 22, 2025

Explanation

The bulk URL scanning functionality in PhishingController previously didn't leverage the URL scan cache that was already implemented for single URL scanning. This meant that even if a URL had been recently scanned, it would be scanned again when included in a bulk scan request, causing unnecessary API calls and increased response times.

This PR extends the caching functionality to the bulkScanUrls method, allowing it to:

  1. Check the cache for each URL before sending API requests
  2. Only scan URLs that aren't already in the cache
  3. Add newly scanned results to the cache for future use
  4. Return a combined response of both cached and newly scanned results

This optimization significantly reduces API calls and improves response times for bulk scan operations, especially when the same URLs are frequently scanned.

References

Related to #5625 (Add URL scan cache functionality)
Extends functionality from #5682 (Add bulk scan functionality)

@AugmentedMode AugmentedMode requested a review from a team as a code owner April 22, 2025 14:53
@AugmentedMode AugmentedMode requested a review from a team as a code owner April 22, 2025 15:04
@AugmentedMode AugmentedMode enabled auto-merge (squash) April 22, 2025 15:11
@AugmentedMode AugmentedMode merged commit 416185b into main Apr 22, 2025
202 checks passed
@AugmentedMode AugmentedMode deleted the feat/cache-bulk-scan branch April 22, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants