astroquery cache should fall back to expired cache if remote fails
- Dominant language
- Python
- Stars
- 791
- Forks
- 451
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Description
Some API backends (like MPC) have extended downtimes, and there is currently not easy way to tell astroquery (post-0.4.6 / #1634) to fall back to an existing expired cached response if the request raises an exception, while still respecting the regular cache expiration for successful requests.
In [requests-cache](https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#expiration-and-error-handling), the equivalent setting would be `stale_if_error=True`. Maybe switching to requests-cache would be a good improvement, since it would allow deep customization of caching behavior, like an offline mode with `only_if_cached=True`.
Contributor guide
Research direction
Start by tracing astroquery's cache behavior introduced after 0.4.6 and the changes referenced in #1634; inspect how remote request exceptions and normal cache expiration are handled. Compare the requested stale-if-error behavior with requests-cache's expiration and error-handling options, then define done as using an expired response only when the remote request fails while preserving regular expiration for successful requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100