Skip to content

Instantly share code, notes, and snippets.

@eidam
eidam / rlimit-com-healthcheck-latency.js
Last active March 16, 2024 20:54
A Cloudflare GQL API request to get health checks RTT (round-trip time), grouped by region.
// GQL API docs => https://developers.cloudflare.com/analytics/graphql-api/
// tldr; => POST https://api.cloudflare.com/client/v4/graphql
const requestBody = {
query: `
query RequestsAndDataTransferByHostname($zoneTag: string, $filter: filter) {
viewer {
zones(filter: {zoneTag: $zoneTag}) {
healthCheckEventsAdaptiveGroups(limit: 10000, filter: $filter) {
dimensions {
@eidam
eidam / cf-worker-polywork-proxy.js
Last active August 26, 2021 06:58
A simple Cloudflare Worker that demonstrates using HTMLRewriter to change 3rd party site (Polywork page)
// This script is running on https://eidam.dev
// change dnsWithPolyworkCustomDomainCname to your CNAME record set to provided record by Polywork
// note: you cannot use Polywork record directly
const dnsWithPolyworkCustomDomainCname = "polywork-origin.eidam.dev"
// change link to your list of links
const links = [
{link: "https://github.com/eidam", name: "🍴 https://github.com/eidam"},
{link: "https://twitter.com/adam_janis", name: "🐤 https://twitter.com/adam_janis"},
{link: "https://statusflare.com", name: "📈 https://statusflare.com"},
### Keybase proof
I hereby claim:
* I am eidam on github.
* I am adamjanis (https://keybase.io/adamjanis) on keybase.
* I have a public key ASDpf6ddBzBm6V86JqpFwyB_FYJucNw_DuzVnXxDTDoTAwo
To claim this, I am signing this object:
Request after Origin status max-age=5 stale-while-revalidate=30 stale-if-error=60
1 sec Up cache hit - -
1 sec Down cache hit - -
10 sec Up miss, revalidate stale cache, refresh -
10 sec Down miss, revalidate stale cache, refresh -
45 sec Up miss, revalidate miss, refresh -
45 sec Down miss, revalidate miss, error stale cache
65 sec Up miss, revalidate miss, refresh -
65 sec Down miss, revalidate miss, error error

Keybase proof

I hereby claim:

  • I am adam-janis on github.
  • I am adamjanis (https://keybase.io/adamjanis) on keybase.
  • I have a public key ASDpf6ddBzBm6V86JqpFwyB_FYJucNw_DuzVnXxDTDoTAwo

To claim this, I am signing this object: