Http Cache Headers Checker avatar

Http Cache Headers Checker

Pricing

$0.01 / actor start

Go to Apify Store
Http Cache Headers Checker

Http Cache Headers Checker

Pricing

$0.01 / actor start

Rating

0.0

(0)

Developer

Eichan Jolly

Eichan Jolly

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 days ago

Last modified

Categories

Features

Limited permissions

Share

One job: Fetch response headers only for a single public HTTP(S) URL and explain what caching instructions the headers declare. The Actor opens one GET request and closes the response without reading its body.

Who is it for?

Web developers, performance engineers, QA testers, and site owners investigating Cache-Control policy for a publicly accessible URL.

Input

{"url":"https://httpbin.org/cache/60"}

url must be one full public HTTP or HTTPS URL. The prefilled example is a real httpbin endpoint documented to send Cache-Control for 60 seconds. The URL has been checked for a nonempty successful HTTP response using public web retrieval; HTTP header details cannot be independently measured from this build environment because outbound DNS is unavailable.

Output

Always one dataset item. Example of a response with Cache-Control: public, max-age=3600 (illustrative):

{
"url": "https://example.org/static/file.css",
"httpStatus": 200,
"cacheControl": "public, max-age=3600",
"maxAgeSeconds": 3600,
"directives": ["public", "max-age=3600"],
"expires": null,
"etagPresent": true,
"lastModified": "Wed, 21 Oct 2015 07:28:00 GMT",
"ageSeconds": 30,
"verdict": "This response declares a cache freshness lifetime of 3600 seconds; actual cache eligibility depends on other HTTP conditions.",
"status": "ok",
"error": null
}

cacheControl, expires, and lastModified preserve response header values without normalization. When repeated Cache-Control headers occur, their values are joined in order with , , following the combined Cache-Control field format. directives preserves directive tokens, including arguments. maxAgeSeconds and ageSeconds are nonnegative integer values, or null when absent/invalid. maxAgeSeconds always reports the max-age value. When s-maxage is also present, the verdict sentence reports the s-maxage value as the shared-cache lifetime, because shared caches follow s-maxage instead of max-age; the two numbers can therefore differ, and both are correct for their audience. etagPresent is presence only, not the ETag value. status is ok, redirect, http_error, or error; error is always user-readable.

verdict is a single sentence derived only from observed headers. It does not guarantee that a response will actually be stored: intermediaries, Vary, authorization, cookies, status code and other conditions can affect cache behavior. no-store takes precedence over lifetimes; no-cache means stored responses need revalidation, not that storage itself is forbidden. private disallows shared-cache storage.

How to run

Apify input is read from the default key-value store INPUT record via the Apify REST API using only the platform-provided runtime token; results are written to the default dataset via Apify REST. No credentials or third-party SDK are requested from the buyer.

Local run from this Actor folder:

$ACTOR_INPUT_JSON='{"url":"https://httpbin.org/cache/60"}' python src/main.py

Alternatively write storage/key_value_stores/default/INPUT.json. Local dataset items appear in storage/datasets/default/. Input order is ACTOR_INPUT_JSON, default Apify key-value-store REST (when its ID is set), then local file.

Limits and safety

  • One public URL. HTTP(S) default ports only; all resolved addresses must be public. No login, forms, JS or cookies.
  • One GET request, body never read, 12-second timeout; redirects never followed. A redirect is reported as its own response and the final URL is not guessed.
  • Reports observed HTTP header values, not assumptions about a site's CDN or performance. Missing headers are null; invalid numeric values are null.
  • Standard-library Python only, no Apify SDK, and no API keys supplied by the user.
  • Live network behavior and Apify cloud build/storage integration remain to be tested on the platform; the supplied script-mode smoke run uses a deterministic fixture.

Reproducible verification

python tests/run_smoke.py
python -m unittest discover -s tests -p 'test_*.py' -v

The smoke runner starts a real subprocess using python src/main.py, while its fixture transport returns deterministic headers. Actual stdout, stderr and output dataset JSON are included in verification/. The fixture is not an actual live httpbin header observation.

Store listing

Category: DEVELOPER_TOOLS (only). Suggested price: $0.002 per successful run, advisory. No publishing or billing was configured.