And 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.