astro-etag
v1.0.2
Published
Simple Astro integration for generating ETag sidecar files for your build.
Readme
astro-etag
Simple Astro integration for generating ETag sidecar files for your build to feed into a web server like Caddy.
Installation
You can use the astro add tool to automatically install without manual configuration:
npx astro add astro-etag
# or
yarn astro add astro-etag
# or
pnpm astro add astro-etagOtherwise, you can install it manually as normal:
npm install astro-etag
# or
yarn add astro-etag
# or
pnpm add astro-etagAnd then update your astro.config file to include the integration:
import { defineConfig } from "astro/config";
import etag from "astro-etag";
export default defineConfig({
integrations: [etag()],
});If you're using other integrations, add astro-etag to the end of your integrations array, so that it can work on every generated fie from previous integrations.
Usage with Caddy
Once built, you can tell Caddy about the .etag files so that it adds ETag headers to all requests by modifying your file_server directive:
file_server {
etag_file_extensions .etag
}If done correctly, you'll see the header in your browser's network inspector.
