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 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| config.py | ||