Skip to content

Commit 572731c

Browse files
committed
Slightly decrease default cache expiration
1 parent 12d9022 commit 572731c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/user_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ the `session` argument for any API request function. It's recommended to use
342342
See Caching and Rate-Limiting sections below for examples.
343343

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

pyinaturalist/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151

5252
# Cache settings
5353
CACHE_EXPIRATION = {
54-
'api.inaturalist.org/v*/controlled_terms*': timedelta(days=30),
55-
'api.inaturalist.org/v*/places*': timedelta(days=7),
56-
'api.inaturalist.org/v*/taxa*': timedelta(days=30),
57-
'*': timedelta(hours=1),
54+
'api.inaturalist.org/v*/controlled_terms*': timedelta(days=1),
55+
'api.inaturalist.org/v*/places*': timedelta(days=1),
56+
'api.inaturalist.org/v*/taxa*': timedelta(days=1),
57+
'*': timedelta(minutes=30),
5858
}
5959
CACHE_FILE = join(CACHE_DIR, 'api_requests.db')
6060
TOKEN_EXPIRATION = timedelta(hours=1)

0 commit comments

Comments
 (0)