http-cache-semantics
npmv4.2.0TypeScriptParses Cache-Control and other headers. Helps building correct HTTP caches and proxies
Adopt with care
http-cache-semantics is usable, with caveats. Last published 439 days ago. 3 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- CMaintenance: grade C, Fair — worth a look.
Last published 439 days ago. 3 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 49 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
BSD-2-Clause — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding http-cache-semantics to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the http-cache-semantics README.
const policy = new CachePolicy(request, response, options);
if (!policy.storable()) {
// throw the response away, it's not usable at all
return;
}
// Cache the data AND the policy object in your cache
// (this is pseudocode, roll your own cache (lru-cache package works))
letsPretendThisIsSomeCache.set(
request.url,
{ policy, body: response.body }, // you only need to store the response body. CachePolicy holds the headers.
policy.timeToLive()
);Dependencies
Declared by http-cache-semantics v4.2.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (1)
Used by
Popular packages that depend on http-cache-semantics.
Relationship graph
Dependencies (left) and dependents (right) of http-cache-semantics.
Frequently installed together
HTTP content negotiation
just emit 'log' events on the process object
Safer Node.js Buffer API
Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.
the http/https agent used by the npm cli
Redact sensitive npm information from output
create a pipeline of streams using Minipass
An implementation of window.fetch in Node.js using Minipass streams
Retries a function that returns a promise, leveraging the power of the retry module.
Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.
Release history
3 releases in the last two years, typically about 44 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.2.0latest | 1 year ago | 49 KB | BSD-2-Clause |
| 4.2.0-beta.2 | 1 year ago | 49 KB | BSD-2-Clause |
| 4.2.0-beta.1 | 1 year ago | 41 KB | BSD-2-Clause |
| 4.1.1 | 3 years ago | 35 KB | BSD-2-Clause |
| 4.1.0 | 6 years ago | 35 KB | BSD-2-Clause |
| 4.0.4 | 6 years ago | 34 KB | BSD-2-Clause |
| 4.0.3 | 7 years ago | 34 KB | BSD-2-Clause |
| 4.0.2 | 7 years ago | 32 KB | BSD-2-Clause |
| 4.0.1 | 7 years ago | 32 KB | BSD-2-Clause |
| 4.0.0 | 8 years ago | 30 KB | BSD-2-Clause |
| 3.8.1 | 8 years ago | — | BSD-2-Clause |
| 3.8.0 | 8 years ago | — | BSD-2-Clause |
| 3.7.3 | 9 years ago | — | BSD-2-Clause |
| 3.7.1 | 9 years ago | — | BSD-2-Clause |
| 3.7.0 | 9 years ago | — | BSD-2-Clause |
Overview
http-cache-semantics is an npm package that parses Cache-Control and other headers. Helps building correct HTTP caches and proxies. It has 1 known dependents in the graph. The latest version is 4.2.0, released under the BSD-2-Clause license.
Who should use it
Teams working in the npm ecosystem who need parses Cache-Control and other headers. Helps building correct HTTP caches and proxies and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (BSD-2-Clause).
- Lean dependency tree (1 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use http-cache-semantics?
http-cache-semantics is usable, with caveats. Last published 439 days ago. 3 releases in the last 2 years.
How do I install http-cache-semantics?
Run `npm install http-cache-semantics` to add http-cache-semantics to your npm project.
What license is http-cache-semantics released under?
http-cache-semantics is distributed under the BSD-2-Clause license.
How popular is http-cache-semantics?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on http-cache-semantics.
Is http-cache-semantics still maintained?
The most recent release of http-cache-semantics (v4.2.0) was published 1 year ago.
Does http-cache-semantics run install scripts?
No. http-cache-semantics does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.