Skip to main content

Rate limits

What this host enforces, which is nothing, and how often its data changes.

No enforced limit and no 429

Nothing on hamletsfriends.com counts requests per client today, and no endpoint answers 429 Too Many Requests. The site is small and its content changes only when we publish, so there is rarely a reason to fetch the same file twice in a few minutes.

How long a copy stays fresh

Static files come from the Azure Static Web Apps edge network. Each response says in Cache-Control how long your copy stays fresh. Send If-None-Match with the ETag you got, and an unchanged file comes back as 304 with no body. Every deploy changes every ETag, so right after a deploy even an unchanged file comes back as 200.

Cache-Control by resource
ResourceCache-Control
Pagespublic, must-revalidate, max-age=30
Markdown twins, /pricing.md, /facts.mdpublic, max-age=300, must-revalidate
/llms.txt, /llms-full.txt, /robots.txt, /sitemap.xml, /openapi.jsonpublic, max-age=3600, must-revalidate
/api/internet-statusno-store
curl
ETAG=$(curl -sI https://hamletsfriends.com/pricing.md | awk 'tolower($1)=="etag:"{print $2}' | tr -d '\r')
curl -s -o /dev/null -w "%{http_code}\n" -H "If-None-Match: $ETAG" https://hamletsfriends.com/pricing.md
JavaScript
const first = await fetch('https://hamletsfriends.com/pricing.md');
const etag = first.headers.get('etag');
const again = await fetch('https://hamletsfriends.com/pricing.md', {
  headers: { 'If-None-Match': etag },
});
console.log(again.status); // 304 while the file is unchanged
Response
HTTP/2 304

Internet status changes every five minutes at most

/api/internet-status serves a stored snapshot. A request refreshes it only when the snapshot is more than five minutes old, and a scheduled job is set to refresh it every five minutes as well. Polling faster returns the same data, so compare updatedAt and poll every five minutes at most. Access rules are on the authentication page.

curl
curl -s https://hamletsfriends.com/api/internet-status \
  -H "x-status-password: $HF_STATUS_PASSWORD" | jq .updatedAt
JavaScript
const FIVE_MINUTES = 5 * 60 * 1000;
setInterval(async () => {
  const response = await fetch('https://hamletsfriends.com/api/internet-status', {
    headers: { 'x-status-password': process.env.HF_STATUS_PASSWORD },
  });
  const { updatedAt, internet } = await response.json();
  console.log(updatedAt, internet.level);
}, FIVE_MINUTES);