Skip to content

Commit 93c6e78

Browse files
author
Andrzej Pijanowski
committed
fix: update QUERYABLES_CACHE_TTL default value to 21600 seconds (6 hours)
1 parent 487f3f7 commit 93c6e78

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Environment variable `VALIDATE_QUERYABLES` to enable/disable validation of queryables in search/filter requests. When set to `true`, search requests will be validated against the defined queryables, returning an error for any unsupported fields. Defaults to `false` for backward compatibility.[#532](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/532)
1313

14-
- Environment variable `QUERYABLES_CACHE_TTL` to configure the TTL (in seconds) for caching queryables. Default is `3600` seconds (1 hour) to balance performance and freshness of queryables data. [#532](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/532)
14+
- Environment variable `QUERYABLES_CACHE_TTL` to configure the TTL (in seconds) for caching queryables. Default is `21600` seconds (6 hours) to balance performance and freshness of queryables data. [#532](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/532)
1515

1616
### Changed
1717

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ You can customize additional settings in your `.env` file:
370370
| `EXCLUDED_FROM_QUERYABLES` | Comma-separated list of fully qualified field names to exclude from the queryables endpoint and filtering. Use full paths like `properties.auth:schemes,properties.storage:schemes`. Excluded fields and their nested children will not be exposed in queryables. If `VALIDATE_QUERYABLES` is enabled, these fields will also be considered invalid for filtering. | None | Optional |
371371
| `EXCLUDED_FROM_ITEMS` | Specifies fields to exclude from STAC item responses. Supports comma-separated field names and dot notation for nested fields (e.g., `private_data,properties.confidential,assets.internal`). | `None` | Optional |
372372
| `VALIDATE_QUERYABLES` | Enable validation of query parameters against the collection's queryables. If set to `true`, the API will reject queries containing fields that are not defined in the collection's queryables. | `false` | Optional |
373-
| `QUERYABLES_CACHE_TTL` | Time-to-live (in seconds) for the queryables cache. Used when `VALIDATE_QUERYABLES` is enabled. | `3600` | Optional |
373+
| `QUERYABLES_CACHE_TTL` | Time-to-live (in seconds) for the queryables cache. Used when `VALIDATE_QUERYABLES` is enabled. | `21600` | Optional |
374374

375375

376376
> [!NOTE]
@@ -436,7 +436,7 @@ To enable queryables validation, set the following environment variables:
436436

437437
```bash
438438
VALIDATE_QUERYABLES=true
439-
QUERYABLES_CACHE_TTL=3600 # Optional, defaults to 3600 seconds (1 hour)
439+
QUERYABLES_CACHE_TTL=21600 # Optional, defaults to 21600 seconds (6 hours)
440440
```
441441

442442
**Behavior:**

stac_fastapi/core/stac_fastapi/core/queryables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, database_logic: Any):
2424
self._last_updated: float = 0
2525
self._lock = asyncio.Lock()
2626
self.validation_enabled: bool = False
27-
self.cache_ttl: int = 3600 # How often to refresh cache (in seconds)
27+
self.cache_ttl: int = 21600 # How often to refresh cache (in seconds)
2828
self.excluded_queryables: Set[str] = set()
2929
self.reload_settings()
3030

@@ -33,7 +33,7 @@ def reload_settings(self):
3333
self.validation_enabled = (
3434
os.getenv("VALIDATE_QUERYABLES", "false").lower() == "true"
3535
)
36-
self.cache_ttl = int(os.getenv("QUERYABLES_CACHE_TTL", "3600"))
36+
self.cache_ttl = int(os.getenv("QUERYABLES_CACHE_TTL", "21600"))
3737

3838
excluded = os.getenv("EXCLUDED_FROM_QUERYABLES", "")
3939
self.excluded_queryables = set()

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/search_engine/selection/cache_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class IndexCacheManager:
1313
"""Manages caching of index aliases with expiration."""
1414

15-
def __init__(self, cache_ttl_seconds: int = 3600):
15+
def __init__(self, cache_ttl_seconds: int = 21600):
1616
"""Initialize the cache manager.
1717
1818
Args:

0 commit comments

Comments
 (0)