Skip to content
Skillv1.0.0

hashfs

Serves content-addressable asset filenames with year-long cache headers.

by golusoris(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from golusoris/golusoris (httpx/static/hashfs/AGENTS.md). Install upstream with npx skills add golusoris/golusoris --skill hashfs. Copyright stays with the author.

Agent guide — httpx/static/hashfs

Serves content-addressable asset filenames with year-long cache headers.

Conventions

  • Wrap the asset FS once: assetsFS := hashfs.New(embeddedAssets).
  • In templates: <link href="/assets/{{ $.Assets.HashName "logo.png" }}">. The rendered URL includes the hash, so cache-busting is free.
  • Mount: r.Mount("/assets", hashfs.Handler(assetsFS)). Requests for /assets/logo-abc.png resolve to the unhashed file transparently.

Don't

  • Don't emit year-long cache on unhashed assets — they can't be invalidated except by renaming. Use httpx/static for those.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/golusoris-golusoris-hashfs/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

golusoris-golusoris-hashfs.ocm.jsonjson
{
  "ocm": "1",
  "id": "golusoris-golusoris-hashfs",
  "kind": "skill",
  "name": "hashfs",
  "description": "Serves content-addressable asset filenames with year-long cache headers.",
  "publisher": "golusoris",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "github-agents"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Serves content-addressable asset filenames with year-long cache headers."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github-agents",
      "repository": "https://github.com/golusoris/golusoris",
      "path": "httpx/static/hashfs/AGENTS.md",
      "ref": "d5a862a77ad92addebfb1bb325c0f1707ca2f243",
      "url": "https://github.com/golusoris/golusoris/blob/d5a862a77ad92addebfb1bb325c0f1707ca2f243/httpx/static/hashfs/AGENTS.md",
      "key": "golusoris/golusoris/httpx/static/hashfs/AGENTS.md"
    }
  },
  "instructions": "# Agent guide — httpx/static/hashfs\n\nServes content-addressable asset filenames with year-long cache headers.\n\n## Conventions\n\n- Wrap the asset FS once: `assetsFS := hashfs.New(embeddedAssets)`.\n- In templates: `<link href=\"/assets/{{ $.Assets.HashName \"logo.png\" }}\">`. The rendered URL includes the hash, so cache-busting is free.\n- Mount: `r.Mount(\"/assets\", hashfs.Handler(assetsFS))`. Requests for `/assets/logo-abc.png` resolve to the unhashed file transparently.\n\n## Don't\n\n- Don't emit year-long cache on *unhashed* assets — they can't be invalidated except by renaming. Use `httpx/static` fo",
  "cost": {
    "context_tokens": 152
  }
}

Fetch it by URL: GET /api/v1/registry/golusoris-golusoris-hashfs/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.