Skip to content

Add caching to /weather endpoint to reduce API calls#269

Open
Muskankr wants to merge 1 commit into
thetechguardians:mainfrom
Muskankr:fix/weather-caching
Open

Add caching to /weather endpoint to reduce API calls#269
Muskankr wants to merge 1 commit into
thetechguardians:mainfrom
Muskankr:fix/weather-caching

Conversation

@Muskankr

Copy link
Copy Markdown

Fixes #263

Changes:

  • Added flask-caching to requirements.txt.
  • Initialized SimpleCache in backend/init.py.
  • Wrapped /weather endpoint with 5 min cache per city/state/country.

Result:
Repeated searches within 5 minutes reuse cached results, reducing OpenWeatherMap API hits and avoiding rate limits.

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.

/weather endpoint has no caching, so repeated searches re-hit OpenWeatherMap every time

1 participant