diff --git a/uncloseai.js b/uncloseai.js index 2fc7fba..ae3dace 100644 --- a/uncloseai.js +++ b/uncloseai.js @@ -48,8 +48,8 @@ const VLLM_ENDPOINTS = [ // This registry maps a model's ID to the endpoint where it resides. const modelRegistry = {}; -// Fetch models from each endpoint with caching (TTL: 1 hour) -// Cache is busted if the endpoint array changes. +// Fetch models from each endpoint with caching. +// Cache is busted if the endpoint array changes or TTL. async function fetchModelsFromEndpoints() { const cacheKey = 'modelRegistryCache'; const endpointsKey = 'vllmEndpointsHash'; @@ -57,7 +57,7 @@ async function fetchModelsFromEndpoints() { const cachedEndpoints = localStorage.getItem(endpointsKey); const cacheItem = localStorage.getItem(cacheKey); const now = Date.now(); - const TTL = 3600000; // 1 hour in milliseconds + const TTL = 300000; // 5 minutes in milliseconds if (cacheItem && cachedEndpoints === endpointsString) { try {