npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edgeone/astro

v1.1.5

Published

Astro adapter for EdgeOne Pages

Readme

@edgeone/astro

This adapter allows astro to deploy your hybrid or server rendered site to EdgeOne Pages.

ISR (Incremental Static Regeneration)

ISR caches your server-rendered pages at the EdgeOne CDN and revalidates them on a time window (stale-while-revalidate), with optional on-demand purge. Astro has no per-page ISR export, so you enable it through the adapter's isr option in astro.config.mjs.

Enable it

// astro.config.mjs
import { defineConfig } from 'astro/config';
import edgeone from '@edgeone/astro';

export default defineConfig({
  output: 'server',
  adapter: edgeone({
    isr: {
      routes: {
        '/blog/**': { expiration: 60, tags: ['blog'] }
      }
    }
  })
});

Only on-demand (SSR) routes are eligible — prerendered/static pages are never affected.

isr option shapes

| Value | Meaning | | --- | --- | | true | Cache all SSR routes until explicitly purged | | 60 (a number) | Cache all SSR routes, revalidate every 60s | | { expiration, tags } | Default applied to all SSR routes | | { routes: { '<glob>': { expiration, tags } } } | Per-route overrides (only the listed routes become ISR) | | { expiration, exclude: ['<glob>'] } | A default plus route-pattern globs to skip |

Per-route config:

  • expiration: revalidation window in seconds. false caches until explicitly purged.
  • tags: cache tags used for on-demand revalidation (see below).

At runtime an ISR route response is tagged with:

eo-cdn-cache-control: s-maxage=<expiration>, stale-while-revalidate=31536000, durable
cache-tag: <tags joined by comma>

Responses carrying Set-Cookie, or cache-control: no-store | private, are never CDN-cached (they stay dynamic), so personalized pages are safe.

On-demand revalidation (purge)

Trigger a regeneration without waiting for the window to elapse:

# purge by tag
curl -X POST https://<your-domain>/__edgeone_revalidate \
  -H 'content-type: application/json' \
  -d '{"token":"<PURGE_TOKEN>","tags":["blog"]}'

# purge by explicit path
curl -X POST https://<your-domain>/__edgeone_revalidate \
  -H 'content-type: application/json' \
  -d '{"token":"<PURGE_TOKEN>","paths":["/blog/hello"]}'

The endpoint is disabled unless the PURGE_TOKEN environment variable is set, and requests must present a matching token (or x-revalidate-token header).

Environment variables

| Variable | Purpose | | --- | --- | | PURGE_TOKEN | Enables and authenticates the /__edgeone_revalidate endpoint | | IS_MAINLAND | Set to true to use the mainland-China purge API endpoint | | SITE_HOST | Fallback host for purge URLs when the request host is unavailable |

Note: ISR cache headers are applied by the adapter at build/runtime, so they only appear on a deployed (or built) site — not under astro dev.

Documentation

Read the @edgeone/astro docs

Support

License

MIT