| Fixture | Status | Description |
|---|---|---|
| 01 Cache Control | ✅ 9/9 | React & Angular cache headers |
| 02 Security Headers | ✅ 7/7 | CSP, HSTS, X-Frame-Options |
| 03 Cache Conflict | ✅ 5/5 | Documents directive conflicts |
Summary: 21 passed, 0 failed, 0 skipped
Last updated: 2026-04-13 18:45:57 UTC (local)
| Fixture | Status | Description |
|---|---|---|
| 01 Cache Control | ✅ 9/9 | React & Angular cache headers |
| 02 Security Headers | ✅ 7/7 | CSP, HSTS, X-Frame-Options |
| 03 Cache Conflict | ✅ 5/5 | Documents directive conflicts |
Summary: 21 passed, 0 failed, 0 skipped
Last updated: 2026-04-13 18:41:05 UTC
This repository contains Apache HTTP Server configuration examples and a BATS-based testing framework for validating different scenarios.
| Fixture | Status | Description |
|---|---|---|
| 01 Cache Control | ❌ 0/9 | React & Angular cache headers |
| 02 Security Headers | ❌ 4/7 | CSP, HSTS, X-Frame-Options |
| 03 Cache Conflict | ❌ 0/5 | Documents directive conflicts |
Summary: 4 passed, 17 failed, 0 skipped
Last updated: 2026-04-13 18:06:36 UTC
Proper cache header configuration for modern JavaScript frameworks:
React (Webpack)
index.html-no-cache, no-store, must-revalidate- Hashed JS/CSS files (e.g.,
main.a3f2b1c.js) -max-age=31536000, immutable
Angular (CLI)
index.html-no-cache, no-store, must-revalidate- Bundles with hash (main, runtime, polyfills) -
max-age=31536000, immutable - Assets folder -
max-age=86400(1 day)
Comprehensive security header configuration:
- Content-Security-Policy (CSP)
- X-Frame-Options: SAMEORIGIN
- X-Content-Type-Options: nosniff
- X-XSS-Protection: 1; mode=block
- Referrer-Policy: strict-origin-when-cross-origin
- Permissions-Policy: feature restrictions
- Strict-Transport-Security (HSTS)
Intentionally misconfigured - demonstrates how directive ordering and always can corrupt location-specific headers. The global Header always set Cache-Control overrides all carefully configured cache headers.
.
├── fixtures/
│ ├── 01-cache-control/ # Cache control for React & Angular
│ ├── 02-security-headers/ # Security headers
│ └── 03-cache-conflict/ # Intentionally wrong config (demo)
├── test/
│ ├── helper.bash # Shared test utilities
│ ├── 01-cache-control.bats # Tests for fixture 01
│ ├── 02-security-headers.bats
│ └── 03-cache-conflict.bats
├── .githooks/
│ └── pre-push # Validates fixtures before push
└── .github/workflows/
└── test.yml # GitHub Actions CI
./scripts/install-hooks.shThis installs a pre-push hook that validates fixture structure before each push.
Requires: BATS and Podman
# Run all tests
cd test
bats *.bats
# Run specific fixture
bats 01-cache-control.bats
# With TAP output
bats --tap 01-cache-control.batsTests run automatically on push. See .github/workflows/test.yml.
MIT