</>PackageGraphPackageGraph

http-cache-semantics

npmv4.2.0TypeScript

Parses 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

49 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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)

mocha ^11.0

Used by

Popular packages that depend on http-cache-semantics.

Relationship graph

Dependencies (left) and dependents (right) of http-cache-semantics.

make-fetch-happenhttp-cache-semant…
http-cache-semantics dependencies dependents

Frequently installed together

Release history

3 releases in the last two years, typically about 44 days apart.

Recent versions of http-cache-semantics
VersionPublishedSizeLicense
4.2.0latest1 year ago49 KBBSD-2-Clause
4.2.0-beta.21 year ago49 KBBSD-2-Clause
4.2.0-beta.11 year ago41 KBBSD-2-Clause
4.1.13 years ago35 KBBSD-2-Clause
4.1.06 years ago35 KBBSD-2-Clause
4.0.46 years ago34 KBBSD-2-Clause
4.0.37 years ago34 KBBSD-2-Clause
4.0.27 years ago32 KBBSD-2-Clause
4.0.17 years ago32 KBBSD-2-Clause
4.0.08 years ago30 KBBSD-2-Clause
3.8.18 years agoBSD-2-Clause
3.8.08 years agoBSD-2-Clause
3.7.39 years agoBSD-2-Clause
3.7.19 years agoBSD-2-Clause
3.7.09 years agoBSD-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.