Add security headers and caching for webmention avatars
- Introduced a new post detailing the implementation of security headers for an Astro site behind Caddy, focusing on Content Security Policy, HSTS, and Referrer Policy. - Added a new post on caching webmention avatars locally at build time to enhance privacy and comply with GDPR. - Implemented a helper function to download and deduplicate webmention avatars, storing them in a cache directory. - Created an Astro integration for garbage collection of orphaned avatar files after the build process.
This commit is contained in:
parent
285ff01303
commit
9d22d93361
7 changed files with 919 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ import mdx from '@astrojs/mdx';
|
|||
import sitemap from '@astrojs/sitemap';
|
||||
import { defineConfig, fontProviders } from 'astro/config';
|
||||
import { loadEnv } from 'vite';
|
||||
import avatarCacheSweep from './src/integrations/avatar-cache-sweep';
|
||||
|
||||
const envMode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
||||
const envVars = loadEnv(envMode, process.cwd(), '');
|
||||
|
|
@ -40,6 +41,7 @@ export default defineConfig({
|
|||
locales: { de: 'de-DE', en: 'en-US' },
|
||||
},
|
||||
}),
|
||||
avatarCacheSweep(),
|
||||
],
|
||||
|
||||
fonts: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue