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

@astro-firebase/hosting

v0.1.0

Published

Firebase Hosting CDN cache provider for Astro

Readme

@astro-firebase/hosting

npm license

A Firebase Hosting CDN cache provider for Astro — the same pattern as @astrojs/netlify/cache, @astrojs/vercel/cache, and @astrojs/cloudflare/cache, targeting Firebase Hosting instead.

It only sets response headers and calls Firebase Hosting's cache-purge endpoint. It does not configure firebase.json and does not deploy — pair it with whatever SSR adapter you already use to run Astro on Firebase (Cloud Functions, Cloud Run, etc.).

Installation

pnpm add @astro-firebase/hosting

Requires astro@^7.0.0.

Usage

// astro.config.mjs
import { defineConfig } from 'astro/config';
import { cacheFirebase } from '@astro-firebase/hosting';

export default defineConfig({
	cache: {
		provider: cacheFirebase({
			hostingUrl: 'https://example.com',
		}),
	},
});

Then, in a page or API route:

// src/pages/index.astro or src/pages/api/*.ts
Astro.cache.set({ maxAge: 300 });

Config

| Option | Type | Default | Description | | --------------- | ------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | | hostingUrl | string | required | Full base URL that invalidate({ path }) sends purge requests against. Never guessed from a Firebase site ID. | | onUnsupported | 'silent' \| 'warn' \| 'error' | 'warn' | How to react to tags, swr, or invalidate({ tags }) — none of which Firebase Hosting's CDN supports. See below. |

What it does and doesn't do

  • maxAge → Cache-Control: public, s-maxage=<maxAge>. Never sets max-age — cache.set() configures CDN freshness only; set your own Cache-Control if you also want to control browser caching.
  • lastModified / etag → passed straight through as Last-Modified / ETag. Nothing is computed. 304 negotiation is handled by Firebase Hosting's CDN itself, like any standard HTTP cache.
  • tags / swr → Firebase Hosting's CDN doesn't support either. Governed by onUnsupported: 'warn' omits the header and logs, 'error' throws, 'silent' does neither.
  • invalidate({ path }) → sends an HTTP PURGE request to <hostingUrl><path>. This is Firebase Hosting's only point-purge mechanism, and it is undocumented and unauthenticated — see ADR-0001 for the risk this carries. Access-control whatever route in your app calls invalidate().
  • invalidate({ tags }) → governed by the same onUnsupported policy, since Firebase Hosting has no tag store to purge against.
  • onRequest → not implemented. Firebase Hosting's CDN already does the caching; there's no in-process store to intercept requests for.

See CONTEXT.md and docs/adr/ for the full domain vocabulary and the reasoning behind these decisions.

License

MIT