This repository is a monorepo for the Cacheable ecosystem, providing a comprehensive suite of caching libraries for Node.js. It includes packages for in-memory caching (CacheableMemory, NodeCache), file-based caching (FlatCache, FileEntryCache), HTTP request caching (CacheableRequest, CacheableNet), and a multi-tier cache manager (cache-manager) used by NestJS. The core Cacheable class implements layered (L1/L2) caching with support for TTL, events, hooks, tag-based invalidation, non-blocking writes, and distributed synchronization via Qified/Redis. The architecture is modular, with each package designed to be used independently or composed together. The codebase is written in TypeScript with extensive test coverage (vitest), dual CJS/ESM builds, and uses modern tooling (biome, pnpm). It emphasizes production-readiness with features like stampede protection (coalesceAsync), per-store TTLs, and statistics tracking. The repository also includes a benchmark package comparing various caching implementations and a documentation website. While the API surface is large, the code demonstrates solid engineering practices and provides genuinely reusable components that solve recurring caching problems.
CacheControl is a Python library that adds HTTP caching to the popular `requests` library. It ports the caching algorithms from httplib2, providing a transparent caching layer for HTTP sessions. The library intercepts HTTP requests and responses, caching responses based on standard HTTP caching headers (Cache-Control, Expires, ETag) and optional heuristic rules. It supports multiple cache backends including in-memory dictionary, file-based cache (with separate body storage for memory efficiency), and Redis. The architecture is modular: a `CacheController` implements the core caching logic (freshness calculation, conditional requests, cache invalidation), while `CacheControlAdapter` integrates with requests' transport adapter system. The library also provides a CLI tool (`doesitcache`) for testing caching behavior. It is well-tested, type-annotated, and follows modern Python packaging practices.
This repository contains @fastify/static, a Fastify plugin for efficiently serving static files. The plugin provides high-performance static file serving with features including MIME type detection, directory listing (JSON/HTML formats), pre-compressed file brokering (brotli/gzip/deflate), range requests, cache control headers, and robust path security to prevent directory traversal attacks. It follows Fastify plugin conventions and decorates reply objects with sendFile and download methods for flexible file serving. The architecture separates concerns with core logic in index.js, directory listing functionality in lib/dirList.js, and error definitions in lib/errors.js. Notable implementation details include concurrent file system operations using fastq for directory listings, sophisticated path normalization and security checks to handle various edge cases (non-canonical paths, dot-dot segments, symbolic links), and intelligent content negotiation for serving the optimal pre-compressed file variant based on client Accept-Encoding headers.
This repository is a Home Assistant custom integration for displaying ICS (iCalendar) calendars. It fetches calendar data from remote URLs, handles authentication and URL templating, parses ICS files using either the 'recurring_ical_events' or 'ics' library, applies event filtering, and exposes the events as a Home Assistant calendar entity. The architecture follows Home Assistant's custom integration patterns with separate modules for data fetching, parsing, filtering, and entity management. While functional, the project shows signs of stagnation due to expressed maintainer lack of motivation, dependency version pinning, and impending obsolescence from Home Assistant's built-in Remote Calendar integration.