feat: comprehensive WCAG 2.1 AA accessibility audit
- Add aria-labels to menu action buttons (PDF, Print, Contact) - Add aria-labelledby to toggle checkboxes (desktop + mobile) - Add -webkit-user-select prefix for Safari compatibility - Add DynamicCacheControl middleware for HTML pages - Add accessibility test suite (60-accessibility.test.mjs) - Add comprehensive accessibility documentation (21-ACCESSIBILITY.md) - Update Modern Web Techniques doc to mark audit complete
This commit is contained in:
@@ -235,3 +235,20 @@ func CacheControl(next http.Handler) http.Handler {
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
// DynamicCacheControl adds appropriate cache headers for dynamic HTML pages
|
||||
// Short cache with must-revalidate for dynamic content
|
||||
func DynamicCacheControl(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// For dynamic HTML pages: short cache, must revalidate
|
||||
// This improves performance while ensuring fresh content
|
||||
if os.Getenv("GO_ENV") == "production" {
|
||||
// Production: 5 minutes cache, but must revalidate
|
||||
w.Header().Set("Cache-Control", "public, max-age=300, must-revalidate")
|
||||
} else {
|
||||
// Development: no cache for easier testing
|
||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
}
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user