{"id":15689628,"url":"https://github.com/marksmurphy/cdn-cache-check","last_synced_at":"2025-07-09T18:09:13.400Z","repository":{"id":40338008,"uuid":"316952443","full_name":"markSmurphy/cdn-cache-check","owner":"markSmurphy","description":"Makes HTTP requests to URLs and parses response headers to determine caching behaviour","archived":false,"fork":false,"pushed_at":"2024-06-22T03:39:17.000Z","size":57788,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T13:05:33.274Z","etag":null,"topics":["cache","cache-control","caching","cdn","cdn-detection","dns","headers","http","https","offload","performance","url","web"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cdn-cache-check","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markSmurphy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-29T13:02:49.000Z","updated_at":"2024-06-24T07:47:31.000Z","dependencies_parsed_at":"2024-06-22T15:53:37.329Z","dependency_job_id":null,"html_url":"https://github.com/markSmurphy/cdn-cache-check","commit_stats":{"total_commits":330,"total_committers":1,"mean_commits":330.0,"dds":0.0,"last_synced_commit":"c4174a5bb801f56ca15386f132b73a805834dbd1"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fcdn-cache-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fcdn-cache-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fcdn-cache-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fcdn-cache-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markSmurphy","download_url":"https://codeload.github.com/markSmurphy/cdn-cache-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883206,"owners_count":21819160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cache-control","caching","cdn","cdn-detection","dns","headers","http","https","offload","performance","url","web"],"created_at":"2024-10-03T18:03:47.198Z","updated_at":"2025-05-07T13:06:00.830Z","avatar_url":"https://github.com/markSmurphy.png","language":"JavaScript","readme":"# cdn-cache-check\n\n![Version](https://img.shields.io/npm/v/cdn-cache-check?style=plastic)\n![node-current](https://img.shields.io/node/v/cdn-cache-check?style=plastic)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b3f25c58277241c887834ccdbab973bb)](https://www.codacy.com/gh/markSmurphy/cdn-cache-check/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=markSmurphy/cdn-cache-check\u0026amp;utm_campaign=Badge_Grade)\n![GitHub issues](https://img.shields.io/github/issues/markSmurphy/cdn-cache-check?style=plastic)\n[![Known Vulnerabilities](https://snyk.io/test/github/markSmurphy/cdn-cache-check/badge.svg?targetFile=package.json)](https://snyk.io/test/github/markSmurphy/cdn-cache-check?targetFile=package.json)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/cdn-cache-check?style=plastic)\n![Downloads Total](https://badgen.net/npm/dt/cdn-cache-check)\n![Downloads/Month](https://img.shields.io/npm/dm/cdn-cache-check.svg?style=plastic)\n![Last Commit](https://badgen.net/github/last-commit/markSmurphy/cdn-cache-check)\n![Licence](https://img.shields.io/npm/l/cdn-cache-check.svg?style=plastic)\n\nHTTP caching is an important component in the delivery of a fast web site. This command line utility helps to analyse URLs to determine if they're served via a CDN and the caching behaviours of both the CDN and the user-agent.\n\n## Quick Start\n\n### Installation\n\nInstall globally using:\n\n```text\nnpm -g install cdn-cache-check\n```\n\n### Simple Usage\n\nCheck a single URL using `ccc [URL]`:\n\n```text\nccc https://www.rolex.com/\n```\n\n![cdn-cache-check - Single URL](https://marksmurphy.github.io/img/ccc.single.url.gif)\n\n### Change Log\n\nSee what's changed recently via the `CHANGELOG.md` which can be found [here](./CHANGELOG.md)\n\n### More Examples\n\nCheck multiple URLs using `ccc [URL [URL […]]]`:\n\n```text\nccc https://www.rolls-royce.com/ https://www.rolls-roycemotorcars.com/\n```\n\n![cdn-cache-check - Multiple URLs](https://marksmurphy.github.io/img/ccc.multiple.urls.gif)\n\nCheck a list of URLs read from a text file using `ccc [filename]`:\n\n```text\nccc URLs.examples.txt\n```\n\n![cdn-cache-check - Single text file](https://marksmurphy.github.io/img/ccc.single.file.gif)\n\nWhere `URLs.examples.txt` contains:\n\n```text\n#List of example URLs\nwww.twitch.tv\nwww.reddit.com\nwww.stackoverflow.com\nwww.adobe.com\nhttps://www.wired.com/\nhttps://www.rolex.com/\n```\n\n---\n\n## Overview\n\nIf you're looking into web site performance you'll be interested, at some stage of your analysis, in caching, compression and CDNs. `cdn-cache-check` aims to help with this task by making HTTP requests and reporting on the response headers that control these aspects across multiple URLs at a time.\n\n![cdn-cache-check - Example of e-commerce domains](https://marksmurphy.github.io/img/ccc.example.ecommerce.gif)\n\n---\n\n## Usage\n\nSupply `cdn-cache-check` with a URL, or the name of a text file containing URLs, and it will issue HTTP requests for each. You can supply multiple URLs or multiple filenames (separated by a `space`), and you can mix-and-match them too if you wish.\n\nIt will also attempt to detect the CDN serving each unique domain by performing a recursive DNS resolution and check if the domain resolves to a known CDN's apex domain.\n\n```text\nccc [URL|file [URL|file […]]] [options]\n```\n\n## Options\n\n### URL\n\nThe `URL` can be any valid URL or a bare domain, in which case `HTTPS` will be used when making the request.\n\n```text\nccc https://example.com\n```\n\n```text\nccc example.com\n```\n\n### filename\n\nThe file should be a plain text file with a URL on each line. Lines which do not contain a valid URL or valid domain name are ignored, so you can have comments and annotation in the file if you so wish.\n\n#### HTTP Archive (HAR) File Support\n\nAs of version 1.3.0 cdn-cache-check supports parsing `.har` files. These can be saved from your browser's Dev Tools:\n\n![ccc - Save as HAR file](https://marksmurphy.github.io/img/ccc.SaveAsHAR.small.png)\n\nYou can then pass that `.har` file to `cdn-cache-check` and it will extract the URLs and make fresh requests for them:\n\n![ccc - Example HAR file](https://marksmurphy.github.io/img/ccc.example.file.har.gif)\n\n### --method\n\nThe default HTTP method is `GET` but you can modify this\n\n```text\nccc example.com --method head\n```\n\n### --headers *collection*\n\nBy default the listed response headers are limited to `x-cache`, `cache-control`, `server`, `content-encoding`, `vary`, `age`; but this is just the **default** headers collection. You can use the `--headers` switch to specify and alternate collection of headers, and can use ``list-header-collections` to view all collections.\n\nFor example, there's a collection that lists **security** related response headers:\n\n```text\nccc https://www.mozilla.org/ --headers security\n```\n\n![cdn-cache-check - Example of header collection 'security'](https://marksmurphy.github.io/img/ccc.example.header.security.gif)\n\n### --list-header-collections\n\nUse `--list-header-collection` to see all of the configured **Header Collections** and which responses are included in each. The location of the configuration file is also shown, which you can edit to include your own custom **Header Collection**.\n\n```text\nccc --list-header-collections\n```\n\n![cdn-cache-check - Example listing all header collections](https://marksmurphy.github.io/img/ccc.example.list-header-collections.gif)\n\n### --list-response-headers\n\n`--list-response-headers` is used to display the names of each unique response header returned from the URL(s) provided. It's primary purpose is to assist with creating a custom [header collection](#--list-header-collection) as it shows all the headers from which a custom list can be selected.\n\n```text\nccc https://www.amazon.com https://www.amazon.co.uk --list-response-headers\n```\n\n![cdn-cache-check - Example listing response headers](https://marksmurphy.github.io/img/ccc.example.list-response-headers.gif)\n\n### --export\n\n`--export` accepts a boolean value and allows you control whether the results are also written to a `.csv` file. The default is `true`; to switch it off use:\n\n```text\nccc https://example.com --export false\n```\n\n### --open\n\nIf the results are exported to a `.csv` file then `--open` will automatically open the file in whatever the registered application for `.csv` files is.\n![ccc - Open exported .csv file Screenshot](https://marksmurphy.github.io/img/ccc.example.open.gif)\n\n### --no-color\n\nSwitches off colour output.  Useful if piping output somewhere which doesn't handle the unicode control codes.\n\n### --version\n\nDisplays the version number.\n\n### --help\n\nDisplays the help screen.\n\n---\n\n## Features\n\n### CDN Detection\n\nThe CDN detection works by perform a recursive DNS lookup on the target domain and looking through the `CNAME` records for an entry in an apex domain that's known to be owned by a CDN service. If the target domain resolves to an `A` record there is no information with which to make a determination, so those domains will be listed as `Undetermined`.\n\nThe detection technique also works for cloud hosting services, so services like AWS's S3, Azure's Blob Storage and GitHub Pages will also be identified.\n\n### .csv Export\n\nAll results will be written in full to a `csv` file in the `temp` directory. The full path of this file is displayed in the terminal.\n\n### Handling redirects\n\nIf the target URL results in a redirect it will be followed, and the final URL will be the one shown in the results. All output entries which are the result of following a redirect are marked with a redirect indicator `®` (and a redirect count in the `csv` export file).\n\n![ccc - Redirect Indictor Screenshot](https://marksmurphy.github.io/img/ccc.example.redirect.png)\n\n```text\nccc http://thefacebook.com\n```\n\n![ccc - Example redirect](https://marksmurphy.github.io/img/ccc.example.redirect.gif)\n\n### Error handling/reporting\n\nNetwork, DNS and HTTP errors are reported in the `STATUS` column.\nExample:\n\n```text\nccc https://www.wallmart.com http://aksjdfkasdnfkja.com\n```\n\n![ccc - Example errors](https://marksmurphy.github.io/img/ccc.example.errors.gif)\n\n---\n\n## Debugging\n\nInclude the `--debug` switch to get verbose debug output.\n\n```text\nccc www.bing.com --debug\n```\n\n![ccc - Example debug](https://marksmurphy.github.io/img/ccc.example.debug.gif)\n\n---\n\n## FAQ\n\n* [Where is the Change Log?](#where-is-the-change-log)\n\n### Where is the Change Log\n\nThe `CHANGELOG.md` can be found [here](./CHANGELOG.md)\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fcdn-cache-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarksmurphy%2Fcdn-cache-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fcdn-cache-check/lists"}