# Playwright HTTP Cache & Revalidation Auditor (`produkdigitalali/playwright-http-cache-revalidation-auditor`) Actor

Compare cold and repeat Chromium visits with cache-hit, 304 revalidation, cache-policy, transfer, and timing evidence without storing response bodies.

- **URL**: https://apify.com/produkdigitalali/playwright-http-cache-revalidation-auditor.md
- **Developed by:** [ProdukDigitalAli](https://apify.com/produkdigitalali) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$12.00 / 1,000 http cache pair auditeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Playwright HTTP Cache & Revalidation Auditor

Compare a cold browser visit with a repeat visit to a public page. Get cache-hit evidence, 304 revalidation, summarized cache policy, and transfer/timing deltas without storing payloads or raw URLs.

### Example

```json
{"urls":["https://example.com/"],"settleMs":500,"navigationTimeoutSeconds":20,"maxResources":100}
```

Supply 1-3 public URLs. Each URL receives its own fresh browser context, two ordinary navigations, and one report. Inputs are deduplicated. settleMs is 0-3000; navigationTimeoutSeconds 5-30; maxResources 1-200 per visit. No credentials, cookies, headers, custom scripts, proxy configuration or interactions are accepted.

### Use cases

- Verify browser cache reuse after CDN/cache-header changes.
- Inspect validators and 304 behavior on deployment assets.
- Compare cold/repeat transfer as a focused complement to HAR diagnostics.
- Add repeatable browser cache checks to release QA.

### Output

Dataset AUDITED rows contain cold and repeat visit summaries and bounded resource records. Each phase has durationMs, resourceCount, cacheHitCount, revalidatedCount, networkBytes, failedRequests and truncated. Resource records have hashed identity, origin, resource type, logical status, wireStatus, cache source, CDP encoded bytes and policy flags. cacheSource browser is an unspecified browser-cache signal, not a guaranteed memory-cache classification. wireStatus may be null if no wire response exists.

transferDeltaBytes = cold minus repeat CDP byte totals; durationDeltaMs = cold minus repeat elapsed times. Positive values do not prove a general speed improvement. OUTPUT summarizes outcomes. cache-\* KVS reports duplicate the structured evidence for integration.

### Safety and limitations

Private, loopback, metadata, reserved and mixed DNS destinations are blocked by a DNS-pinned proxy. Service workers and downloads are disabled. Do not interpret serviceWorkerMode blocked as evidence that the target has no service worker. This does not test PWA offline behavior or cache invalidation across deployments. No browser routing is used because it disables cache.

Page and resource paths/query values are hashed; only origins remain readable. No response bodies, cookies, header contents or validator strings are persisted. Policy fields are flags, safe numeric durations and validator-presence booleans. Browser background/late traffic, resource caps, cookies created during the first visit, and dynamic pages can affect comparison. HTTP cache coldness is local to the fresh browser; CDN/origin caches may already be warm. Byte totals are CDP evidence, not billing-transfer measurements, origin hit counts, or Lighthouse/Web Vitals scores.

### Pricing proposal

Standard tier: USD 0.012 per cache-pair-audited event after dataset and KVS evidence persist. Failed pairs free. A successful pair with no cache hits remains a useful audit. Platform costs depend on plan and usage. The Actor is configured for pay per event at USD 0.012 per successfully stored pair.

### Suggested tasks

Cold/repeat homepage check; deployment asset revalidation audit; compare public landing-page cache behavior. Repeat over time under consistent browser/settings; no automated load testing.

### Local execution

Node 22+, locked npm dependencies, Chromium executable in APIFY_CHROME_EXECUTABLE_PATH. npm test runs meaningful browser fixtures. Put input at storage/key_value_stores/default/INPUT.json and npm start. Tests have an internal loopback fixture option that production input never exposes.

# Changelog

This Actor's version history is a separate document: https://apify.com/produkdigitalali/playwright-http-cache-revalidation-auditor/changelog.md

# Actor input Schema

## `urls` (type: `array`):

One to three pages; each receives two normal navigations in a fresh browser context.

## `settleMs` (type: `integer`):

Additional observation time after each page load.

## `navigationTimeoutSeconds` (type: `integer`):

Maximum per-visit navigation time.

## `maxResources` (type: `integer`):

Maximum CDP resource records retained per visit.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "settleMs": 500,
  "navigationTimeoutSeconds": 20,
  "maxResources": 100
}
```

# Actor output Schema

## `summary` (type: `string`):

No description

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("produkdigitalali/playwright-http-cache-revalidation-auditor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://example.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("produkdigitalali/playwright-http-cache-revalidation-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://example.com/"
  ]
}' |
apify call produkdigitalali/playwright-http-cache-revalidation-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,produkdigitalali/playwright-http-cache-revalidation-auditor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ieD0OKrEilhKg9dh9/builds/VpY9M0HfyYaukRnM9/openapi.json
