Multiple concurrent users browsing the 3.2M recipe corpus would cause FTS5 page cache contention and slow per-request queries. Solution: pre-compute counts for all category/subcategory keyword sets into a small SQLite cache. - browse_counts_cache.py: refresh(), load_into_memory(), is_stale() helpers - config.py: BROWSE_COUNTS_PATH setting (default DATA_DIR/browse_counts.db) - main.py: warms in-memory cache on startup; runs nightly refresh task every 24h - infer_recipe_tags.py: auto-refreshes cache after a successful tag run so the app picks up updated FTS counts without a restart |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| db | ||
| models | ||
| services | ||
| staples | ||
| static | ||
| styles | ||
| tasks | ||
| utils | ||
| __init__.py | ||
| cloud_session.py | ||
| main.py | ||
| tiers.py | ||