Skip to content

[RTY-260011] : Cache implementation#16

Merged
recursivezero merged 13 commits intodevelopfrom
feature/RTY-260011
Feb 16, 2026
Merged

[RTY-260011] : Cache implementation#16
recursivezero merged 13 commits intodevelopfrom
feature/RTY-260011

Conversation

@harshmishra2701
Copy link
Contributor

@harshmishra2701 harshmishra2701 commented Feb 11, 2026

…TTL and documentation"

Pull Request Template

Description

This PR introduces an in-memory caching layer to speed up short URL resolution and reduce repeated database lookups. The cache stores both short_code → original_url and original_url → short_code mappings with a TTL of 15 minutes. This helps handle frequent requests efficiently (e.g., repeated access to the same 5 URLs within a short time window).

Fixes #11

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Verified that repeated requests for the same short URLs are served from cache within the TTL window.
  • Verified cache expiry after 15 minutes results in fallback to DB fetch.
  • Ran the application locally and confirmed URL creation and redirection work as expected with caching enabled.

Test Configuration:

  • Browser: Chrome
  • Device: laptop

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
    📸 Additional context (Screenshots / Evidence)
Screenshot 2026-02-11 165457 Screenshot 2026-02-11 164457 Screenshot 2026-02-11 165515

@recursivezero recursivezero changed the title [RTY-260011] [RTY-260011] : Cache implementation Feb 11, 2026
@recursivezero recursivezero added the need work require changes label Feb 11, 2026
@recursivezero recursivezero changed the base branch from main to develop February 12, 2026 10:33
@recursivezero
Copy link
Owner

recursivezero commented Feb 16, 2026

getting error when run poetry run tiny api and execute shorten POST API

AttributeError: module 'app.utils.data' has no attribute 'urls'

image

@recursivezero recursivezero merged commit 66f678c into develop Feb 16, 2026
@recursivezero recursivezero deleted the feature/RTY-260011 branch February 16, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need work require changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

❇️ [RTY-260011]: add cache strategy

2 participants