Skip to main content
Glama
sirsambhav221

MCP Docker Hub Server

cache.js950 B
class Cache { constructor() { this.cache = new Map(); } set(key, value, ttlMs = 300000) { // Default 5 minutes const expiry = Date.now() + ttlMs; this.cache.set(key, { value, expiry }); } get(key) { const item = this.cache.get(key); if (!item) return null; if (Date.now() > item.expiry) { this.cache.delete(key); return null; } return item.value; } clear() { this.cache.clear(); } // Clean up expired entries cleanup() { const now = Date.now(); for (const [key, item] of this.cache.entries()) { if (now > item.expiry) { this.cache.delete(key); } } } } // Create a singleton instance const cache = new Cache(); // Clean up expired entries every 5 minutes setInterval(() => cache.cleanup(), 300000); module.exports = cache;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sirsambhav221/MCPDCOKER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server