Skip to content

feat: cache repeated searches for 60 seconds - #71

Merged
Emmy123222 merged 1 commit into
Emmy123222:mainfrom
Heazzy500:fix/issue-21
Sep 3, 2026
Merged

feat: cache repeated searches for 60 seconds#71
Emmy123222 merged 1 commit into
Emmy123222:mainfrom
Heazzy500:fix/issue-21

Conversation

@Heazzy500

Copy link
Copy Markdown

Summary

  • add a bounded 100-entry LRU cache with a 60-second TTL
  • key entries by query, result count, and freshness
  • count cache hits while returning cached: true
  • only cache successful Serper responses after payment middleware has accepted the request

Closes #21

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@zeemscript is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Heazzy500 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@AbuJulaybeeb AbuJulaybeeb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve conflicts

@Heazzy500

Copy link
Copy Markdown
Author

@Emmy123222 The merge conflicts for this PR have been resolved against the latest main and pushed to Heazzy500:fix/issue-21. Please re-run/inspect CI when available.

@AbuJulaybeeb

Copy link
Copy Markdown
Collaborator

@Emmy123222 The merge conflicts for this PR have been resolved against the latest main and pushed to Heazzy500:fix/issue-21. Please re-run/inspect CI when available.

@Heazzy500 fetch upstream main, rebase upstream/main, then u push

@Heazzy500

Copy link
Copy Markdown
Author

@Emmy123222 Merge conflicts resolved for this PR against latest main. Rebased fix/issue-21 onto upstream/main and pushed — new head: 5cbd796. Conflict files: package.json, package-lock.json, server/index.ts (plus src/types/index.ts change to type the cached field on SearchResponse). Validation: git diff --check clean, working tree clean, remote head verified; node_modules not present so full typecheck not run. Please review / re-run CI when convenient. Thanks!

@Heazzy500
Heazzy500 force-pushed the fix/issue-21 branch 2 times, most recently from 9a7658e to 5cbd796 Compare September 1, 2026 14:47
@Heazzy500

Copy link
Copy Markdown
Author

@Emmy123222 @Heazzy500 PR #71 was rebased onto the current upstream main. The cache implementation is now combined with the current search route, preserving request reconciliation and validation while adding bounded TTL caching. The repaired branch is pushed at commit 9e273b3 and ready for CI/review.

@Emmy123222
Emmy123222 merged commit 00ed3f4 into Emmy123222:main Sep 3, 2026
0 of 2 checks passed
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.

Cache repeated search queries server-side (short TTL) to save Serper.dev quota

4 participants