Skip to content

Commit

Permalink
Slightly decrease default cache expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Sep 7, 2021
1 parent 12d9022 commit 572731c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ the `session` argument for any API request function. It's recommended to use
See Caching and Rate-Limiting sections below for examples.

## Caching
All API requests are cached by default. These expire in 1 hour for most endpoints, and
longer for some infrequently-changing data (like taxa and places). See
All API requests are cached by default. These expire in 30 minutes for most endpoints, and
1 day for some infrequently-changing data (like taxa and places). See
[requests-cache: Expiration](https://requests-cache.readthedocs.io/en/latest/user_guide/expiration.html)
for details on cache expiration behavior.

Expand Down
8 changes: 4 additions & 4 deletions pyinaturalist/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@

# Cache settings
CACHE_EXPIRATION = {
'api.inaturalist.org/v*/controlled_terms*': timedelta(days=30),
'api.inaturalist.org/v*/places*': timedelta(days=7),
'api.inaturalist.org/v*/taxa*': timedelta(days=30),
'*': timedelta(hours=1),
'api.inaturalist.org/v*/controlled_terms*': timedelta(days=1),
'api.inaturalist.org/v*/places*': timedelta(days=1),
'api.inaturalist.org/v*/taxa*': timedelta(days=1),
'*': timedelta(minutes=30),
}
CACHE_FILE = join(CACHE_DIR, 'api_requests.db')
TOKEN_EXPIRATION = timedelta(hours=1)
Expand Down

0 comments on commit 572731c

Please sign in to comment.