Spaces:
Running
Running
perf: reduce apps cache TTL from 24h to 5min
Browse filesHF Hub API rate limits allow up to 1000 requests per 5-minute window
for free users. With only 2 API calls per refresh, a 5-minute cache
is well within limits and ensures new community apps appear quickly.
Co-authored-by: Cursor <cursoragent@cursor.com>
- server/index.js +1 -1
server/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const app = express();
|
|
| 8 |
const PORT = process.env.PORT || 7860;
|
| 9 |
|
| 10 |
// Cache configuration
|
| 11 |
-
const CACHE_TTL_MS =
|
| 12 |
const OFFICIAL_APP_LIST_URL = 'https://huggingface.co/datasets/pollen-robotics/reachy-mini-official-app-store/raw/main/app-list.json';
|
| 13 |
const HF_SPACES_API = 'https://huggingface.co/api/spaces';
|
| 14 |
// Note: HF API doesn't support pagination with filter=, so we use a high limit
|
|
|
|
| 8 |
const PORT = process.env.PORT || 7860;
|
| 9 |
|
| 10 |
// Cache configuration
|
| 11 |
+
const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
| 12 |
const OFFICIAL_APP_LIST_URL = 'https://huggingface.co/datasets/pollen-robotics/reachy-mini-official-app-store/raw/main/app-list.json';
|
| 13 |
const HF_SPACES_API = 'https://huggingface.co/api/spaces';
|
| 14 |
// Note: HF API doesn't support pagination with filter=, so we use a high limit
|